How To Convert Filenames To Lowercase On Unix

To make the conversion character we will use the tr (translate characters) Unix command.

Create a file with some characters uppercase;

touch MyLittleFile.LOG

Run the following command. It is a mv in which we say rename the old and new files with all lowercase characters;

mv MyLittleFile.LOG `echo MyLittleFile.LOG | tr [:upper:] [:lower:]`

And we get the following result;


With this command we can also proceed backwards, go to uppercase. Run the following commands;

mv mylittlefile.log `echo mylittlefile.log | tr [:lower:] [:upper:]`

And get change the file name as stated below;




Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s