tr
from-chars to-chars
tr 'X' 'x' Translate all capital X's to small x's
tr '()' '{}' Translate all open parens to open braces, all closed parens to closed braces
tr '[a-z]' '[A-Z]' Translate all lowercase letters to uppercase
tr '[A-Z]' '[N-ZA-M]' Translate uppercase letters A–M to N–Z, and N–Z to A–M, respectively
tr ' ' ' ' Translate all tabs (character in first pair of quotes) to spaces
tr -s ' ' ' ' Translate multiple spaces to single spaces
tr -d '/14' Delete all formfeed (octal 14) characters
tr -d '[0-9]' Delete all digits
$ cut -d: -f1,6 /etc/passwd
root:/
cron:/
bin:/
uucp:/usr/spool/uucp
asg:/
steve:/users/steve
other:/
$
$ cut -d: -f1,6 /etc/passwd | tr : ' '
root /
cron /
bin /
uucp /usr/spool/uucp
asg /
steve /users/steve
other /
$
$ date | tr ' ' '/12' Translate spaces to newlines Sun
Jul
28
19:13:46
EDT
2002
$
$ tr '[a-z]' '[A-Z]' < intro
THE UNIX OPERATING SYSTEM WAS PIONEERED BY KEN
THOMPSON AND DENNIS RITCHIE AT BELL LABORATORIES
IN THE LATE 1960S. ONE OF THE PRIMARY GOALS IN
THE DESIGN OF THE UNIX SYSTEM WAS TO CREATE AN
ENVIRONMENT THAT PROMOTED EFFICIENT PROGRAM
DEVELOPMENT.
$
$ tr '[A-Z]' '[a-z]' < intro
the unix operating system was pioneered by ken
thompson and dennis ritchie at bell laboratories
in the late 1960s. one of the primary goals in
the design of the unix system was to create an
environment that promoted efficient program
development.
$
$ sed 's/ //g' intro
TheUNIXoperatingsystemwaspioneeredbyKen
ThompsonandDennisRitchieatBellLaboratories
inthelate1960s.Oneoftheprimarygoalsin
thedesignoftheUNIXsystemwastocreatean
environmentthatpromotedefficientprogram
development.
$
tr 'X' 'x' Translate all capital X's to small x's
tr '()' '{}' Translate all open parens to open braces, all closed parens to closed braces
tr '[a-z]' '[A-Z]' Translate all lowercase letters to uppercase
tr '[A-Z]' '[N-ZA-M]' Translate uppercase letters A–M to N–Z, and N–Z to A–M, respectively
tr ' ' ' ' Translate all tabs (character in first pair of quotes) to spaces
tr -s ' ' ' ' Translate multiple spaces to single spaces
tr -d '/14' Delete all formfeed (octal 14) characters
tr -d '[0-9]' Delete all digits
$ cut -d: -f1,6 /etc/passwd
root:/
cron:/
bin:/
uucp:/usr/spool/uucp
asg:/
steve:/users/steve
other:/
$
$ cut -d: -f1,6 /etc/passwd | tr : ' '
root /
cron /
bin /
uucp /usr/spool/uucp
asg /
steve /users/steve
other /
$
$ date | tr ' ' '/12' Translate spaces to newlines Sun
Jul
28
19:13:46
EDT
2002
$
$ tr '[a-z]' '[A-Z]' < intro
THE UNIX OPERATING SYSTEM WAS PIONEERED BY KEN
THOMPSON AND DENNIS RITCHIE AT BELL LABORATORIES
IN THE LATE 1960S. ONE OF THE PRIMARY GOALS IN
THE DESIGN OF THE UNIX SYSTEM WAS TO CREATE AN
ENVIRONMENT THAT PROMOTED EFFICIENT PROGRAM
DEVELOPMENT.
$
$ tr '[A-Z]' '[a-z]' < intro
the unix operating system was pioneered by ken
thompson and dennis ritchie at bell laboratories
in the late 1960s. one of the primary goals in
the design of the unix system was to create an
environment that promoted efficient program
development.
$
$ sed 's/ //g' intro
TheUNIXoperatingsystemwaspioneeredbyKen
ThompsonandDennisRitchieatBellLaboratories
inthelate1960s.Oneoftheprimarygoalsin
thedesignoftheUNIXsystemwastocreatean
environmentthatpromotedefficientprogram
development.
$