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  
Old 07-27-2007, 02:22 AM
oxygen oxygen is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 632
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
  #2  
Old 07-27-2007, 03:04 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 881
kingmaker is on a distinguished road
Send a message via MSN 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 Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Workgroup rename in Server2003 bluesky Server Management 8 10-01-2009 12:43 AM
Rename Files in Bulk in Windows XP srikumar_l Operating Systems 0 12-19-2007 08:42 PM
How can I rename all files in a folder using Java? leoraja8 Java Programming 4 11-12-2007 11:15 PM
How to Protect our text from copying in flash? kingmaker Flash Actionscript Programming 1 07-21-2007 01:50 AM
Display html files in Flash oxygen Flash Actionscript Programming 1 07-18-2007 11:54 PM


All times are GMT -7. The time now is 07:31 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0