Subj : Re: gnu utils To : MeaTLoTioN From : acn Date : Wed Jan 12 2022 16:13:00 Am 11.01.22 schrieb MeaTLoTioN@1337:1/101 in TQW_LINUX: Hallo Meatlotion, M> $ cat somefile.txt | grep something | wc -l vs. M> $ grep -c something somefile.txt While you are totally right that the latter is much shorter and might also be quicker, you have to _know_ and _remember_ that grep is able to count on its own. Not unlike deon said, the UNIX principle is that you have small tools with one functionality each and the UNIX power is the possibility to connect them. And while the first line is absolutely a good example for a "useless use of cat" (that even I wouldn't have written), it is also an example for that: get the contents of a file, filter it and count the resulting lines. To achieve that, you 'only' have to know how to filter using grep and how to count lines using wc. That knowledge can be used for many other tasks as well. Whereas knowing that "-c" in grep can count the occurances of a certain thing in a file is kind of a one-off knowledge that might be forgotten sooner than later... Regards, Anna --- OpenXP 5.0.51 * Origin: Imzadi Box Point (1337:1/108.1) .