shows non-printable characters in a printable way.
has two options for displaying white space in a line.
If you use the -t
option with -v
characters are shown as
option combined with -v
marks the end of each line
Some versions of cat
don't require the -v
with those options.
Let's compare a one-line file without and with the -t -e
have to be typed separately, by the way; -te
This is a one-line file - boring, eh?
cat -v -t -e afile
ThiS^Hs is^Ia one-line file^I- boring, eh? $
Although you can't tell it from plain cat
, there's a backspace
(CTRL-h) before the first
, two TABs that take up only
one column of white space each, and seven spaces at the end of the line.
Knowing this can help you debug problems in printing and displaying files.
It's also a help for shell programmers who need to parse or sort the output
of other programs.