The aim for above is to batch rename files. Should do like this, according to the faq:
You can also convert file names into "mv" commands with 'sed', and hand the commands off to "sh" for execution. Try
ls -d *.foo | sed -e 's/.*/mv & &/' -e 's/foo$/bar/' | sh
This is only work for changing the extensions! and a better way to do is just: |
for i in *.txt; do mv $i `basename $i .txt`.c; done