LoginSignup
3
1

More than 5 years have passed since last update.

ファイル内一括検索とファイル内一括置換のコマンド

Posted at

ファイル内一括検索

find /path/to/dir/ -type f -print | xargs grep "検索対象の文字列"

具体例

find /path/to/dir/ -type f -print | xargs grep "hogehoge"

ファイル内一括置換

find /path/to/dir/ -type f -print | xargs sed -i -e "s/置換対象の文字列/置換後の文字列/g"

具体例

find /path/to/dir/ -type f -print | xargs sed -i -e "s/hogehoge/hugahuga/g"
3
1
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
3
1