Skip to content

Instantly share code, notes, and snippets.

@sinanm89
Created April 7, 2021 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sinanm89/4b10091b54ed189a373f40ff9e8a1cf0 to your computer and use it in GitHub Desktop.
Save sinanm89/4b10091b54ed189a373f40ff9e8a1cf0 to your computer and use it in GitHub Desktop.
find_and_replace_all_files_directories.sh
# change all the folders and files' names from "source" to "destination". This will not replace contents
source='' destination='' find . -type d -iname '*${source}*' | while read FILE ; do
newfile="$(echo ${FILE} |sed -e 's/${source}/${destination}/')" ;
mv "${FILE}" "${newfile}" ;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment