Skip to content

Instantly share code, notes, and snippets.

@krusynth
Created December 6, 2014 17:54
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 krusynth/3387fc846540287379a4 to your computer and use it in GitHub Desktop.
Save krusynth/3387fc846540287379a4 to your computer and use it in GitHub Desktop.
file rename bash
# Find a *lot* of files with the wrong extension and fix the extension.
for myfile in $(find /var/www/releases/sanfranciscocode/*/production/current/htdocs/downloads/current/code-text -name "*..txt" -type f); do
filetrim=${myfile%????};
mv $myfile $filetrim"txt";
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment