1. tr
character translation filter.
1.1
Either tr "A-Z" "*" <filename or tr A-Z \* <filename
changes all the uppercase letters in filename to asterisks (writes to stdout). On some systems this may not work, but tr A-Z '[**]' will.
1.2
The -d option deletes a range of characters.
echo "abcdef" # abcdef
echo "abcdef" | tr -d b-d # aef
tr -d 0-9 <filename # Deletes all digits from the file "filename".
1.3
The --squeeze-repeats (or -s) option deletes all but the first instance of a string of
consecutive characters. This option is useful for removing excess whitespace.
echo "X3XXXX" | tr --squeeze-repeats 'X' # X3X
1.4
2. cat
cat, an acronym for concatenate, lists a file to stdout. When combined with redirection (> or >>), it 2.1
2.2
The -n option to cat inserts consecutive numbers before all lines of the target file(s).
The -b option numbers only the non-blank lines.
The -v option echoes nonprintable characters, using ^ notation.
The -s option squeezes multiple consecutive blank lines into a single blank line.
2.3
In a pipe, it may be more efficient to redirect the stdin to a file, rather than to cat the file.
cat filename | tr a-z A-Z
3. tac
tac, is the inverse of cat, listing a file backwards from its end.
3.1
tac errorfix
c
b
a
cat errorfix
b
c