shell script to rename multiple files

by Ramya 2009-11-07 20:30:47

shell script to rename multiple files:

Renaming multiple files in a folder is easy using linux shell script.

Save this file in a ".sh" extension to tell the system that this a shell script. Place this file inside the folder where you want to rename multiples files.

For example, here we have used the script to rename all .gif files to .jpg files.
#!/bin/bash
for x in *.gif;
do n=${x/.gif/.jpg};
echo $n;
mv $x $n;
done


Modify the script to your requirement.
Razz

Tagged in:

1453
like
0
dislike
0
mail
flag

You must LOGIN to add comments