I recently purchased an audio book as mp3s and it arrived with filenames as 39483053_001.mp3
, 39483053_002.mp3
and so on with an incremental counter at the end.
To change just the numeric ID into something more meaningful, you can run this shell command in bash:
for file in *.mp3 ; do mv $file ${file//39483053/audio-book-name} ; done
It will loop over all .mp3
files and for each, replace 39483053
with audio-book-name
.
If the files are expected (or can) have spaces in them, you can wrap the first $file
into double quotes (as in, "$file"
) and the parameter expansion part as well ("${file//39483053/audio-book-name}"
).