Linux/Unix – Changing File Names to Lowercase…

Changing File Names to Lowercase

To change the uppercase letters in a file name to lowercase (or viceversa), use chcase. It takes as arguments the files whose names it should change. To change the file names of all of the files in the current directory to lowercase letters, type:

$ chcase *

 

Use the `−u’ option to change file names to all uppercase letters.

To change file names of all of the files with a `.dos’ extension in the `~/tmp’ directory to all uppercase letters, type:

$ chcase −u ~/tmp/*.dos

 

By default, chcase does not rename directories; use the `−d’ option to rename directories as well as other files. The `−r’ option recursively descends into any subdirectories and renames those files, too.

· To change all of the files and subdirectory names in the current directory to all lowercase letters, type:

$ chcase −d *

 

To change all of the files and subdirectory names in the current directory to all uppercase letters, and descend recursively into all subdirectories, type:

$ chcase −d −r −u *

 

To change all of the files in the current directory to all lowercase letters, and descend recursively into all subdirectories (but do not change any directory names), type:

$ chcase −r * 

Advertisements

About msotela

This blog is for anyone who wants to access the power of a Linux system as a systems administrator or user. You may be a Linux enthusiast, a Linux professional, or possibly a computer professional who is increasingly finding the Windows systems in your data center supplanted by Linux boxes.

Posted on March 15, 2009, in Unix/Linux. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: