---
title: "sed 学习"
author: "itoday"
date: "2012-07-24T17:06:45Z"
tags: []
categories: ["操作系统"]
slug: "sed"
draft: false
lastmod: "2012-07-24T17:06:36Z"
id: 1605759
url: "https://itoday.iteye.com/blog/1605759"
---

可在行首加入#

sed -i '/home/{s/^/#/}/' /etc/fstab

另一个例子

*sed* '/import/{s/^/#/;s/$/ test/}'