Difficulty: Easy
Correct Answer: wc
Explanation:
Introduction / Context:
This question covers a basic command line utility in Unix and Linux environments. System administrators, programmers and power users often need quick statistics about text files, such as how many lines, words or characters they contain. The operating system provides a simple command that produces these counts in one step. Computer awareness exams and Linux certification tests frequently ask you to identify this command by name, so it is useful to remember its short but descriptive abbreviation.
Given Data / Assumptions:
Concept / Approach:
The Unix command used to count the number of lines, words and bytes or characters in a file is wc, which stands for word count. By default, running wc with a file name prints three numbers: line count, word count and byte count or character count depending on the implementation. Additional options can be used to show only one of these statistics, but the key point is that wc is the standard utility for these measurements. Scripts and tutorials often demonstrate wc as the tool of choice for quick file statistics. The other names in the options, such as count p or wcount, are not standard Unix commands and are likely distractors.
Step-by-Step Solution:
Verification / Alternative check:
Unix and Linux manuals and online help pages describe wc as a utility that prints newline, word and byte counts for each file. The command is part of the core utility sets installed on almost every Unix like system. Using the manual page man wc shows options to count only lines, only words or only characters, but the default behaviour includes all three. The other command names listed in the options do not appear in standard documentation for basic Unix utilities. This evidence confirms that wc is the correct answer for the task described in the question.
Why Other Options Are Wrong:
Common Pitfalls:
Because wc is very short, some learners mistakenly believe the exam will use a longer, more descriptive name like wcount. However, Unix tradition favours short command names. Another pitfall is forgetting that wc counts lines and characters as well as words, leading some to think there must be a more complex tool. To avoid these errors, practise basic shell commands and remember that wc alone is sufficient to count lines, words and characters in a simple text file.
Final Answer:
The Unix command used to count lines, words and characters in a file is wc.
Discussion & Comments