C Books Guide and List
C++ Books Guide and List
Best Java Books

3,749 questions

4,049 answers


10,705 users

How do I rename all the files from .htm to .html after copying them from a PC to a UNIX machine?

0 votes
asked by omari Sr Member (3,860 points)

1 Answer

0 votes
UNIX's mv (`move') command won't handle wildcard filenames. However, there's a program called htmaddl (for `HTM-add-"L"'), so you can login and type htmaddl. This will rename all .htm files to .html
If you haven't got this program on your UNIX machine, you can type it into a file called htmaddl: #! /bin/sh for f in *.htm; do base=`basename $f .htm` mv $f $base.html done After saving it and exiting your editor, make it executable by typing the command chmod ugo+x htmaddl Best of all, move it into your ~/bin directory, or ask your WebMeister to put it in /usr/local/bin so everyone can use it.
answered by sunny Expert (11,410 points)

Related questions

0 votes
1 answer 1,505 views
0 votes
1 answer 12 views
0 votes
0 answers 161 views