Which command will print line numbers before each line in a file?
A.
ln
B.
nl
C.
cat -n
D.
numline
Explanation:
cat -n prints a line number in front of EVERY line of the file, where nl does not number the empty lines.
In my opinion both B and C would be correct
The question says “each line”… wouldn’t that mean empty line or not?
I like cat -n
“each line” is not mean “empty line “
Actually, I do know some place put answer to be cat -n. Cause it is more reasonable for “each line”
Question is “Which command …” and in fact cat command does not print numbers before each line , but nl does . cat with -n option give desired result.