Today I learnt that grep has a '-c' switch that counts occurrences. I'll never pipe it to 'wc -l' again!
$ ps aux | grep -c adam
93
But if we use wc, we would also need to trim it:
$ ps aux | grep adam | wc -l
94
So, use -c.
Today I learnt that grep has a '-c' switch that counts occurrences. I'll never pipe it to 'wc -l' again!
$ ps aux | grep -c adam
93
But if we use wc, we would also need to trim it:
$ ps aux | grep adam | wc -l
94
So, use -c.
For further actions, you may consider blocking this person and/or reporting abuse
Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.
Rachel Duncan -
Mike Young -
Mike Young -
Alexey Timin -
Top comments (0)