Vidyalelo
Computer Science · Q23

UNIX

Engineering and GATE · Computer Science · question 23

Q23

Which command is used to count just the number of characters in a file?

A.
wc - 1
B.
wc -c
Answer
C.
wc -w
D.
wc -r
E.
None of the above

Answer: Option B

Solution

Answer: Option B
Solution:
In Unix, the wc command is used to count words, lines, and characters in a file. The -c option specifically instructs wc to count just the number of characters in the file.
So, wc -c is the correct command to count just the number of characters in a file.