#!/bin/bash
j=1
for i in *.pdf
do
mv $i "sequence-point-stack-$j.pdf"
j=$((j+1))
done
for i in *.pdf
do
mv $i "sequence-point-stack-$j.pdf"
j=$((j+1))
done
In this script you just need to change the extension as your requirement and the name that you want to give the files. But beware of this fact that if extension is not part of the name of the file this script wont do. Like if you a have two pdf file "lolo" and "lola.pdf" then only the "lola.pdf" will be affected. Another thing that it wont work for those case where you want to rename the file with totally different strings. For example if you want to rename two file as "hehe-1" and "hoho-2" then this script wont work. In generalized case the script will look like:
#!/bin/bash
j=1
for i in *.<<your extension>>
for i in *.<<your extension>>
do
mv $i "<<the name you want to give>>$j.<<your extension>>"
j=$((j+1))
done
mv $i "<<the name you want to give>>$j.<<your extension>>"
j=$((j+1))
done
** Don't forget to remove "<<" and ">>".
No comments:
Post a Comment