Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "cat -A" command option mean in Unix

I'm currently working on a Unix box and came across this post which I found helpful, in order to learn about cat command in Unix. At the bottom of the page found this line saying: -A = Equivalent to -vET

As I'm new into Unix, I'm unaware of what does this mean actually? For example lets say I've created a file called new using cat and then apply this command to the file: cat -A new, I tried this command but an error message comes up saying it's and illegal option.

To cut short, wanted to know what does cat -A really mean and how does it effect when I apply it to a file. Any help would be appreciated.

like image 322
Kulasangar Avatar asked Nov 24 '25 18:11

Kulasangar


1 Answers

It means show ALL.

Basically its a combination of -vET

E : It will display '$' at the end of every line.
T : It will display tab character as ^I
v : It will use ^ and M-notation

^ and M-notation:

(Display control characters except for LFD(LineFeed or NewLine) and TAB using '^' notation and precede characters that have the high bit set with 'M-')

M- notation is a way to display high-bit characters as low bit ones by preceding them with M-

You should read about little-endian and big-endian if you like to know more about M notation.

For example:

!https://i.sstatic.net/7tSo8.png

like image 122
Anurag Kanungo Avatar answered Nov 27 '25 09:11

Anurag Kanungo