//View Tip #140
Similar Tips
» Change file extension revisited
» Change extension of files in the current directory
» Command line currency conversion
» SVN resolve all conflicts
» Find and replace with backup


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