Skip to content

Instantly share code, notes, and snippets.

@michchan
Created February 27, 2020 05:33
Show Gist options
  • Save michchan/f8f795e2af606c09e23733b1c6213cde to your computer and use it in GitHub Desktop.
Save michchan/f8f795e2af606c09e23733b1c6213cde to your computer and use it in GitHub Desktop.
Bash Script to Search and Replace Directory Names
find . -type d -name "*NameToReplace*" | while read f; do mv $f $(echo $f | sed "s/NameToReplace/ReplacedName/g"); done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment