Skip to content

Instantly share code, notes, and snippets.

@edo9k
Last active September 12, 2016 12:00
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 edo9k/af4647eebb5f5660574fe34a996e1bec to your computer and use it in GitHub Desktop.
Save edo9k/af4647eebb5f5660574fe34a996e1bec to your computer and use it in GitHub Desktop.
Bash one liner to crop all file names in one directory to the length specified in the 'cut' command. (This is done the hard & dumb way here, I'm pretty sure rename can do it better with the proper regex. I can't regex very that well.)
for i in $files; do echo "mv $i $(echo $i | cut -c 1-8)"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment