Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Recursive find and replace using sed in Mac OS X
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
You can’t perform that action at this time.