Friday, May 15, 2009

renaming multiple files in Solaris

If those are the only 3 files ending in .log in your directory, you could do this:

for i in `ls *.log`;do
mv $i $i.bak
done

That would do each one individually but loop through the 3 files so you only have to do the one command.

No comments:

Post a Comment

About

Blogger templates