How to Convert Files to Upper or Lower Case?

So you want to convert your files on your Windows, Linux or Unix OS to all lower case or all upper case. Well, on Linux or UNIX there are more than one ways to accomplish a task. One of the way to convert all text in a file (input.txt) to lower case (output.txt) in Linux or UNIX OS is using following command in a shell:

dd if=input.txt of=output.txt conv=lcase

Similarly, to convert a file to upper case use the following command:

dd if=input.txt of=output.txt conv=ucase

Note: The article is about converting all text(alphabets) in a file to upper or lower case and not the file names.

Converting a file to upper or lower case on Windows

On Windows, it can be quite difficult to do this operation as command prompt doesn't provide any specify command for it. To do this in CMD, you will have to create complex batch scripts but using FireCMD you can make this stuff very easy. Just follow the steps given below:

  1. If you don't have FireCMD then download from this page and install it.
  2. Open FireCMD shell and just use the commands specified above for Linux/UNIX. Done!

You can also create aliases for these commands, so that you don't have to remember and type the whole command line again and again. Enter the following commands to create aliases for converting file to lower or upper case respectively.

alias file_tolower dd if="+|openfile "Select file to convert into lowercase|" of="+|savefile "Specify output file name"|" conv=lcase

alias file_toupper dd if="+|openfile "Select file to convert into lowercase|" of="+|savefile "Specify output file name"|" conv=ucase

After creating the aliases, you can simply type file_tolower or file_toupper to do the operation. Note that we have also used openfile and savefile commands with command substitution to make things easier. When you will execute these aliases, you will be shown an Open File dialog box to specify the input file and Save As dialog box to specify the output file name.