The Man-Page of cat says:
-v, --show-nonprinting
use ^ and M- notation, except for LFD and TAB
What is the M- notation and where is it documented?
Example:
$cat log -A
wrote 262144 bytes from file test.x in 9.853947s (25.979 KiB/s)^M$
^M> ^H^H ^H^H>
Waht means ^M
and ^H
?
^M
is for Control-M (a carriage return),^H
for Control-H (a backspace).M-Something
is Meta-Something (Meta- is what the Alt key does in some terminals).I was wondering this too. I checked the source but it seemed easier to create a input file to get the mapping.
I created a test input file with a Perl scrip
for( my $i=0 ; $i < 256; $i++ ) { print ( sprintf( "%c is %d %x\n", $i, $i ,$i ) ); }
and then ran it through cat -vAlso if you see M-oM-;M-? at the start of a file it is the UTF-8 byte order mark.
Scroll down through these to get to the M- values: