for N in *.xml; do mv $N ${N/%xml/txt} done #### perl -e 'qx!for N in *.xml\; do mv \$N \${N/%xml/txt}\; done!;'