Last active
January 13, 2021 01:36
-
-
Save evoknow/9048e2d65685e586277179da64c5ebcc to your computer and use it in GitHub Desktop.
Shell Script to Rename MP3 Files
This file contains 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
#!/bin/bash | |
# This simple script renames all the MP3 (.mp3) files in the current directory | |
# to myprefix_000.mp3, myprefix_001.mp3, etc. | |
# | |
# Change the "myprefix" with whatever prefix you want | |
# | |
# Mac User Group (MUG) YouTube Channel Video Reference: | |
# https://www.youtube.com/watch?v=YsPRMsnSBW0 | |
################################################################################# | |
ls -1 *.mp3 | awk '{printf("mv \"%s\" %s_02d.mp3\n", $0, "myprefix", i++)}' | sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment