Created
June 3, 2016 15:56
-
-
Save dmgig/4b79fd2d29f7e52e5b5764b5475d6002 to your computer and use it in GitHub Desktop.
Find/Replace Inside Files and In Filenames (Mac 10.11)
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
#!/bin/bash | |
find /path/to/files -type f -exec sed -i "" 's/oldtext/newtext/g' {} \; # find/repalce inside files | |
find /path/to/files -type f -name "*" -exec sh -c 'mv "$0" "${0/oldfilenametext/newfilenametext}"' '{}' \; # find and replace in filenames |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment