0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

grep, sedを使用して複数ファイル内の特定の文字列を一括置換

Last updated at Posted at 2022-04-01

(自身の備忘録用です)

特定の文字列が含まれるファイルを一括検索し、任意の文字列に置換するコマンドです

  • -i:ファイルの内容を上書き
grep -r [検索文字列] ./ -l | xargs sed -i -e 's/[検索文字列]/[置換文字列]/g'
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?