tr

Translate or delete characters Used to transliterate characters Accepts 2 args; set of characters to convert from and convert to

  1. An enumerated list, ABCDE…
  2. A character range, A-Z
  3. POSIX character classes, [:upper:]

Examples #

Delete tr -d '\r' < dos_file > unix_file

Squeeze

[me@linuxbox ~]$ echo "aaabbbccc" | tr -s ab
abccc