Skip to content

Instantly share code, notes, and snippets.

@icaoberg
Created December 4, 2012 04:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icaoberg/4200576 to your computer and use it in GitHub Desktop.
Save icaoberg/4200576 to your computer and use it in GitHub Desktop.
[BASH] Remove substring from filename
#!/bin/bash
SUBSTRING='substring_to_remove'
for FILE in *
do
mv -v "$FILE" "${FILE/$SUBSTRING/}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment