Computer Science - Unix - Discussion

Discussion Forum : Unix - Section 1 (Q.No. 23)
23.
Which command is used to count just the number of characters in a file?
wc - 1
wc -c
wc -w
wc -r
None of the above
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
4 comments Page 1 of 1.

Ganesh said:   1 decade ago
wc command is used for counting.
It,s switches,
l - No. of 'Lines'
w - No. of 'Words'
c - No. of 'Characters'

Just remember with initials.

Rohit said:   1 decade ago
wc stands for word count.

The suffix -c: counts characters only
-l: lines only
-w: words only

And if you don't use any of them then the command wc gives all lines / words / characters.

S.R.R. said:   1 decade ago
wc -l <filename> print the line count.
wc -c <filename> print the byte count.
wc -m <filename> print the character count.
wc -L <filename> print the length of longest line.
wc -w <filename> print the word count.

D D said:   8 years ago
Here l is used to count the number of bytes in a file,
w prints the number of words in a file and,
l prints the number of lines in a file.

Post your comments here:

Your comments will be displayed after verification.