Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
shell one-liner - rename files in current directory with digits stripped from filenames
# rename files in current directory with digits stripped from filenames
# first do a dry-run (only print the commands that will be applied)
for f in *; do echo mv "$f" $(printf '%s' "$f" | tr -d '0123456789'); done
# run it for real (modifications done in-place)
for f in *; do mv "$f" $(printf '%s' "$f" | tr -d '0123456789'); done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.