//Random Tip
Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow

You are viewing a random entry, refresh your browser to change.

To change the extension on a group of files using only bash builtins and mv:

for i in *.txt; do mv $i ${i%%.txt}.html; done

View Comments »


Add your comment

Comments are currently disabled
you forgot the quotes:

 for i in *.txt; do mv "$i" "${i%%.txt}".html; done

also see: http://www.shell-fu.org/lister.php?id=27
Posted 2009-02-14 19:10:17

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit