BASH script to remove numeric prefix from files downloaded from scribd

Scribd is a great service, offering PDF downloads of a variety of content.  Unfortunately there is an ugly 8 digit (random?) number prefixed on each file downloaded.


It’s not descriptive, and it makes alphabetic sorting of the files downloaded impossible.  Here’s a small BASH shell script that will remove the first 9 characters (8 digits and the – character) from all pdf files in a directory.

for f in *.pdf; do
[ ! -f $file ] && mv "$f" $file

Create the above in a file, save it, and be sure to use chmod +x filename to make the shell script executable.

About the author


I'm an all around computer junkie, interested in many aspects of programming, operating systems, and enterprise IT technologies. I love Mac OS X, Linux, and Windows and more!