How to rename multiple files in a directory? Suppose I have 20 .txt files in a directory.Now I want to rename these files to .doc I tried mv *.txt *.doc but I got message that while moving multiple files last argument must be a directory.
Try the following :
for i in *.txt; do j=`expr "$i" : "(.*).txt"`.doc; mv $i $j; done
- Keyur