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
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.