I am bit confuse about the command
cat filename.txt -b
and
cat filename.txt -n
They show the same output to the screen .Then what is the difference between them?
I am bit confuse about the command
cat filename.txt -b
and
cat filename.txt -n
They show the same output to the screen .Then what is the difference between them?
In cat
, -b
shows the line numbers of non-empty lines, whereas -n
shows the line numbers of all lines regardless of emptiness.
Example:
% cat -n file.txt
1 foo
2
3 bar
% cat -b file.txt
1 foo
2 bar
Also note that -b
overrides -n
when used together:
% cat -bn file.txt
1 foo
2 bar