Last active
June 23, 2016 15:16
-
-
Save lloydroc/d4f7e13bfe7211f8d9a416222ecc1327 to your computer and use it in GitHub Desktop.
Search Replace Multiple Files
This file contains 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
perl -pi -w -e 's/search/replace/g;' $( grep -rl 'search' . ) | |
# Perl arguments | |
# -e means execute the following line of code. | |
# -i means edit in-place | |
# -w write warnings | |
# -p loop over the input file, printing each line after the script is applied to it. | |
# Grep Arguments | |
# r is recursive which defaults to NOT following symbolic links | |
# l is listing the file names only | |
# the . is the directory you want to search in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment