0
While running
ps -eaf
I see a list of running processes.
Is it possible to count the number to lines using awk?
0
While running
ps -eaf
I see a list of running processes.
Is it possible to count the number to lines using awk?
1
The best way to do it, in the sense of the simplest way to do it, is to issue the command:
ps -eaf | wc -l
The command wc was originally written to count words, but it can also count lines (that's the -l option), characters (-m), bytes (-c),... see man wc.
0
ps -eaf | awk '{ ++cnt } END { print cnt }'