Can `wc` combine options?

QuestionsQuestions8 SkillsProDec, 22 2025
098

Yes, absolutely! You can combine options in wc just like many other Linux commands.

You can combine them in two ways:

  1. Grouped symbols: You can put the letters together after a single dash. For example, to see both the line count and the byte count:

    wc -lc /etc/passwd
  2. Separate symbols: You can list them individually:

    wc -l -c /etc/passwd

Examples of combinations:

  • wc -lw: Displays lines and words.
  • wc -wc: Displays words and characters.
  • wc -lwc: Displays all three (this is the same as the default output when you run wc without options).

This is a great way to filter exactly the information you need. Give it a try in your terminal!

0 Comments

no data
Be the first to share your comment!