Quote:
Originally Posted by Mubarak's
Oh My God .. you just need like the following command to do this simple operator:
|
mv *.txt *.doc will expand to:
mv a.txt b.txt *.doc
*.doc will be interpreted as a directory and fail.
Another ways to do this (my personal favorite):
ls /path/to/dir/*.ext1 | sed -e "s/^\(.*\).ext1/\1.ext1 \1.ext2/g" | xargs -n 2 mv -f
But alas, someone decided that was too much to bear, so in comes:
rename .ext1 .ext2 /path/to/dir/*.ext1
Hehe, hope this helps.