renaming the filename

view full story

http://www.unix.com – Hi, I have several files with name Code: b1.root, b2.root b3.root I want to rename the "b" to "bkg", so finally is should be: Code: bkg1.root bkg2.root bkg3.root I used command: Code: rename s/b/bsig/ b*root Somehow it is working at some place and not working in other folder. I do not have any idea why this would be the case. I even found a shell script: Code: for filename in *.txt do   echo $filename;   w_o_ext=`basename $filename .txt`;   echo $w_o_ext;   mv $filename $w_o_ext.psql; done I want to modify this to serve (HowTos)