Last active
January 24, 2018 02:47
-
-
Save naokazuterada/929ecb35c02a4429754fbc05fdcb9b8f to your computer and use it in GitHub Desktop.
CLIで文字列を含むファイルの一覧取得・置換
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 一覧の取得 | |
grep "something you want" -rl ./ | |
# .htaccess内の文字列の置換(バックアップファイルを作って、後で削除) | |
find . -name "*.htaccess" -exec sed -i".backup_mogemoge" "s|/home/users/0/moge|/home/users/0/moge2|" {} \; | |
find . -name "*.backup_mogemoge" -exec rm {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment