changing upper/lower case with tr

August 4th, 2006 mysurface Posted in Text Manipulation, tr | Hits: 43979 | 2 Comments »

tr is actually a common translator, here I show you how to convert

string from uppercase to lowercase

echo "UPPER" | tr [A-Z] [a-z]

from lower to upper

echo "lower" | tr [a-z] [A-Z]


2 Responses to “changing upper/lower case with tr”

  1. you need quotes on some linux (ubuntu)

    echo “UPPER” | tr “[A-Z]” “[a-z]”

  2. tr ‘[[:upper:]]’ ‘[[:lower:]]’


    tr ‘[[:lower:]]’ ‘[[:upper:]]’

Leave a Reply