Tuesday, May 27, 2008

How to give each file a common extension using shell script

Say, you want to rename each file in a directory to .old

just do this:

for i in `ls -1`
do
mv $i $i\.old
done

This will do the trick.

No comments: