//View Tip #140
Similar Tips
» Counts files in the current directory and subdirectory
» Find files greater than a certain size
» Reverse geocode with bash
» Bash
» Local/remote webserver

 

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
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 »




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