View Full Version : convert file extension
jr_yeo
12-01-2008, 04:40 AM
how to convert one file extension to another in a single command line in linux?
i want to convert *.html to *.php recursively and retain the original file.
Well, one way, perhaps not the most elegant:find -iname '*.php' /top/directory -exec cp {} `dirname {}`/`basename {} .php`.html \;I'm pretty sure something better is possible in zsh with regular expressions, but it's too early for the man pages to make sense. :p
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.