Script to change the file extension on multiple files

Sometimes it becomes necessary to change the file extension on multiple files. For example, you may be migrating a website and want to change all the extensions from .htm to .html. Or perhaps you have installed a php application like phpBB and want to use a different file extension from the default (.html instead of .php). This script can accomplish this for you in one quick step.

You can grab the script here:

http://www.nixer.org/eb/chg_ext.sh

This script ONLY works on file names. It does nothing to the contents of the files themselves. In the case where you are changing static .htm files to .html files, you will still need to update the links inside of the HTML.

Please be sure to backup your files before running the script. You have only yourself to blame if something goes wrong. The script is a standard Bourne shell script with the only dependencies being the find and sed commands. To check if you have these commands, do:

$ which find
/usr/bin/find
$ which sed
/bin/sed

To run the script, place it in the directory containing the files you want to rename. Make the script executable:

$ chmod u+x chg_ext.sh

Now, run the script with the following syntax:

$ chg_ext.sh php html

where 'php' is the old extension and 'html' is the new extension. In other words, all .php files will be renamed .html.

The script works recursively so it will rename all files in subdirectories as well.

This is a very good

This is a very good tutorial.
Mortgage rates
Lung Cancer
Dexamethasone

great

This is indeed a great post, I would surely love to know more about it. I will look forward to see more
Tooth Whitening
Reverse Phone Lookup
Acai Berries

Don't use singular to cover

Don't use singular to cover an bronhial asthma assault that has already set out. It will not bring singulair tablets quick enough to reverse your evidences. Use only a fast-acting inhalation medicament to treat an asthma attack..