How can I get the number of Linux processes (including lightweight processes)?
I want to see how many before I hit the limit dictated by /proc/sys/kernel/pid_max
.
How can I get the number of Linux processes (including lightweight processes)?
I want to see how many before I hit the limit dictated by /proc/sys/kernel/pid_max
.
I think you search for something like
ps -elfT | wc -l
You use the ps
command to show all processes with threads (Light Weight Processes). The -T
command do this for you. You should check the man page of ps
to look around which arguments are useful for you.
The wc -l
command will count the printed lines of the ps
command.
Every process and every thread get a own line with the command ps -elfT
.