LoginSignup
4
5

More than 5 years have passed since last update.

複数ファイルから指定した文字列とマッチした行を削除する

Last updated at Posted at 2015-01-29

-iで上書き、-eで処理する内容を指定する。
下はディレクトリにあるyamlファイルでabcという文字列が含まれている行をすべて削除(d)する。

$ sed -i -e '/abc/d' *.yaml

参考

Linux である文字を含む行を削除したい - Enjoi Blog
sedでファイルを上書き保存

4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5