Linux Tutorial Series

Linux Tutorial Series – 49 – The wc command

Here is the video version, if you prefer it:

The wc command is used to display the number of lines, words and bytes contained in files. (Shotts, 2019)⁠ It is used as follows:

wc fileName

It outputs three numbers – the first number is the number of lines in a file, the second number is the number of words contained in a file and a third number is the number of bytes contained in a file.

An example:

mislav@mislavovo-racunalo:~$ cat file.txt

Some line

Some other line

mislav@mislavovo-racunalo:~$ wc file.txt

2 5 26 file.txt

I have personally never used this command (never had the need).

Hope you learned something useful today!


Shotts, W. (2019). The Linux Command Line, Fifth Internet Edition. Retrieved from Page 87