Answers

Question and Answer:

  Home  HTML

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

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.

 156 views

More Questions for you: