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コマンドでファイルを上書き編集

藤沢瞭介(Ryosuke Hujisawa)
  • りょすけと申します。18歳からプログラミングをはじめ、今はフロントエンドでReactを書いたり、AIの勉強を頑張っています。off.tokyoでは、ハイテクやガジェット、それからプログラミングに関する情報まで、エンジニアに役立つ情報を日々発信しています!

未整理記事