//View Tip #140
Similar Tips
» Checksum directory recursively
» Loop over files with spaces in the name
» Directories and its size
» Zero files
» Find last modified files on a filesystem


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 »


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