Which command is used to count just the number of characters in a file? A. wc – 1 B. wc -c C. wc -w D. wc -r E. None of the above

[amp_mcq option1=”wc – 1″ option2=”wc -c” option3=”wc -w” option4=”wc -r E. None of the above” correct=”option2″]

The correct answer is B. wc -c.

The wc command is used to count the number of lines, words, and characters in a file. The -c option tells wc to count only the number of characters.

The other options are as follows:

  • A. wc -1: This option tells wc to count the number of lines in a file.
  • C. wc -w: This option tells wc to count the number of words in a file.
  • D. wc -r: This option tells wc to read the file in reverse order.
  • E. None of the above: This is not a valid option for the wc command.
Exit mobile version