Lower to Uppercase in Linux

To convert a lower case string to uppercase one can use the echo (prints a line of text) and tr (translates=) command. An example is as follows:

echo "make this uppercase" | tr "[a-z]" "[A-Z]"

The result will be “MAKE THIS UPPERCASE”. In the example above we tell translate to convert all lower case characters a through z to uppercase A through Z.

Be the first to comment

Leave a Reply