Created
August 7, 2017 07:05
-
-
Save anish749/1c1fa6d6f487004b5fc0d1770620df81 to your computer and use it in GitHub Desktop.
Recursive find and replace using sed in Mac OS X
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
find . -type f -name '*.java' -exec sed -i '' 's/find/replace/g' {} + | |
# Find files (type f) | |
# with name *.java | |
# execute sed -i (inplace) | |
# '' means no backup files to be created | |
# 's/find/replace/g' sed command to do actual replace | |
# {} + the output of the find command is concatanated and fed to sed. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment