Created
October 26, 2020 17:31
-
-
Save mmubasher/be00a9c90d6fe04e4d9c89dacd29767b to your computer and use it in GitHub Desktop.
Find and replace files and directories by name
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 . -name '*new_name*' -type f -exec bash -c 'mv $0 ${0/previous_name}' {} \; | |
find . -name '*new_name*' -type d -exec bash -c 'mv $0 ${0/previous_name}' {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment