ホーム

How to replace with sed command?

Replace with sed command

If you want to replace a string using the sed command, you can replace it with the "- e" and "- i" options. It is convenient to take backup. You can convert multiple files simultaneously. The following example is an example of replacing the string Linux in source.txt and source.txt 2 with Linux.

sed -i".org" -e "s/Linux/リナックス/g" path/source.txt path/source2.txt

reference

【 sed 】 文字列の置換,行の削除を行う

sedコマンドでファイルを上書き編集

Pocket
LinkedIn にシェア

-ホーム

Copyright© off , 2020 All Rights Reserved Powered by AFFINGER5.