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
lsusb | wc -l
/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