Jump to content

Linux wc Command Explained for Beginners

  • Please log in to reply
No replies to this topic

#1 OFFLINE   securitybreach


    CLI Phreak

  • Forum Admins
  • 24,027 posts

Posted 30 December 2017 - 12:49 PM

Linux from the command line - Using the Word Count (wc) command

wc is a very simple program that is very handy and very powerful.

It allows you to count things. The obvious use is counting the words in an essay to make sure you've reached the assigned 5000 word minimum for example. But when combined with bash scripts, wc has a lot more diverse and powerful uses, especially when combined with pipes and redirects.

For example, if you want to know how many PCI devices are in your system, type:

lspci | wc -l

USB devices?

lsusb | wc -l

Posted ImagePosted Image Posted Image
CNI Radio/G+ Profile/Configs/PGP Key/comhack π

"Do you begin to see, then, what kind of world we are creating? It is the exact opposite of the stupid hedonistic Utopias that the old reformers imagined. A world of fear and treachery and torment, a world of trampling and being trampled upon, a world which will grow not less but more merciless as it refines itself. Progress in our world will be progress toward more pain." -George Orwell, 1984

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users