One unique feature of Linux dedicated servers is the powerful command line. There are virtually no limits to what you can accomplish with the right command strings and a little patience. Often times server administrators are faced with daunting tasks, such as migrating large amounts of data, restoring backups, and reassigning permissions. More often than not, these tasks are performed at the requests of users and web hosting clients.
Renaming files in Linux is very simple, although the command might not be what you would expect. To rename files, you need to execute the “mv”command. The letters “mv” stand for “move”. Essentially, you are moving the file from one name to another. To do this, follow this format:
mv filename-a.html to filename-b.html
This is simple, but it does not work for multiple files. Just as an example, suppose a client of yours needs the file extensions of several files changed from “.htm” to “.html”. The “mv” command cannot accomplish this with one quick swipe. In this case, the “rename” command actually works better.
To change the filename extensions, you would enter the command like this:
rename -v 's/\.htm$/\.html/' *.htm
The “.htm” represents the part of the file you are renaming to “.html”, and “*.htm” tells it to find all files with that extension. For very simple renaming schemes this works just fine. If you ever need something more sophisticated, you will need to learn some scripting. For a complete guide to batch renaming, visit this site.