UNIX & GNU/Linux - User commands - Using wc

The user command wc is a GNU/Linux tool written by Paul Rubin and David MacKenzie.

It helps us to display the number of lines, words and bytes counted in one or several files.

Let's see an example of the user command wc by executing this command in our favourite terminal:

$ wc -l *

It will display the number of lines in all files present in the current directory.

You can combine all flags at the same time and the result will be displayed in different colums:

$ wc -cmlLw *

You can now see the number of bytes, chars, lines, max-line-length and words in all files of your current directory!

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.