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.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Refresh Type the characters you see in this picture. Type the characters you see in the picture; if you can't read them, submit the form and a new image will be generated. Not case sensitive.  Switch to audio verification.