LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Change file extentions in a directory tree (https://www.linuxquestions.org/questions/linux-newbie-8/change-file-extentions-in-a-directory-tree-505396/)

threelions66 11-27-2006 08:55 PM

Change file extentions in a directory tree
 
I'm tying to pipe two commands in order to change .htm files to .html
in a directory tree. Both commands work separately but not when piped.


1st find /root/Desktop/Cisco -name *.htm

2nd rename .htm .html *.htm




[me@box Cisco]# find /root/Desktop/Cisco -name *.htm | rename .htm .html *.htm

rename: renaming *.htm to *.html failed: No such file or directory
[me@box Cisco]#

Thanks

zetabill 11-27-2006 09:13 PM

Did you try
Code:

find /root/Desktop/Cisco -name *.htm -exec rename .htm .html '{}' \;

threelions66 11-27-2006 09:22 PM

Perfect, Thank you


All times are GMT -5. The time now is 02:11 PM.