taiki-t's diary

React Native, Rails そして雑多な記録: The world is waiting for you to give it a meaning.

command

ターミナルでgit grep して一括置換するコマンド

$ git grep -l 'search word' | xargs sed -i '' -e 's/search word/replacing word/g' こんな感じ。 search word, replacing wordはそれぞれgrepする語、置換後の語を指定。 git grep -lで対象の語が含まれるファイル一覧を取得、 | xargsでそれを sedコマ…