Created
October 8, 2018 21:54
-
-
Save cgoldberg/5e9e165487c977ecfb6cb2c82289b9d2 to your computer and use it in GitHub Desktop.
shell one-liner - rename files in current directory with digits stripped from filenames
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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