Google News
logo
Unix - Quiz(MCQ)
Which Unix command is used for counting words, lines, and characters in a file?
A)
wc
B)
diff
C)
man
D)
count

Correct Answer :   wc


Explanation : UNIX provides a universal word counting program that allows us to count the number of words, lines and characters in a file. It takes a filename as an argument as produces a 4 column output.

$ wc file01
3   9   45  file01​

Above output indicates that file01 contains 3 lines, 9 words and 45 characters.

Advertisement