LoginSignup
8
6

More than 5 years have passed since last update.

ファイルの中身の一部を置換して書き換える

Posted at

以下のような内容のファイルがあるとします。

$ cat file
Hello!!
This is original text.

sedコマンドでファイルの中身を書き換えることができます。

$ sed -i -e "s/original/replaced/" file

$ cat file
Hello!!
This is replaced text.

置き換わりました。

8
6
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
8
6