← Blog

Tr - Traducción de Caracteres

Apuntes y comandos de Tr - Traducción de Caracteres para Linux.

# tr, translate
# replace and delete chars from stdin

cat sample.txt | tr ',' '\t'
# replace comma as delim by tabs

cat sample.txt | tr 'a-z' 'A-Z'
# lowercase to uppercase
# we can also use sets for this

cat sample.txt | tr '[:lower:]' '[:upper:]'