IT Community - Software Programming, Web Development and Technical Support

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

This is a discussion on How do I rename all the files from .htm to .html after copying them from a PC to a UN within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; How do I rename all the files from .htm to .html after copying them from a PC to a UNIX ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > HTML, CSS and Javascript Coding Techniques

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-27-2007, 03:22 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 633
oxygen is on a distinguished road
Question How do I rename all the files from .htm to .html after copying them from a PC to a UN

How do I rename all the files from .htm to .html after copying them from a PC to a UNIX machine?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-27-2007, 04:04 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Default Re: How do I rename all the files from .htm to .html after copying them from a PC to

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.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me to rename the flex project seesamjagan Adobe Flex Programming 0 01-03-2008 10:55 PM
Rename Files in Bulk in Windows XP srikumar_l Operating Systems 0 12-19-2007 09:42 PM
How can I rename all files in a folder using Java? leoraja8 Java Programming 4 11-13-2007 12:15 AM
How to Protect our text from copying in flash? kingmaker Flash Actionscript Programming 1 07-21-2007 02:50 AM
Display html files in Flash oxygen Flash Actionscript Programming 1 07-19-2007 12:54 AM


All times are GMT -7. The time now is 08:49 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0