Skip to content

Instantly share code, notes, and snippets.

@Arkham
Created January 9, 2014 15:36
Show Gist options
  • Save Arkham/8336035 to your computer and use it in GitHub Desktop.
Save Arkham/8336035 to your computer and use it in GitHub Desktop.
Rename files removing extra characters
#! /bin/bash
set -e
DIR=${1:-.}
PRUNED_CHARS=":?"
find $DIR -type f -print | while read filename
do
cleaned=${filename//[$PRUNED_CHARS]/}
echo mv "$filename" "$cleaned"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment