Posted: . At: 7:48 AM. This was 5 years ago. Post ID: 12635
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


Get just the number of processes on your Linux machine.


This command will print the number of running processes on a Linux system.

4.4 Tue Oct 30 jason@Yog-Sothoth 0: $ ps aux | wc -l
255

Here is a nice alternative that will work on Ubuntu. The landscape-common package will install this utility.

4.4 Tue Oct 30 jason@Yog-Sothoth 0: $ landscape-sysinfo | grep Processes: | awk '{print $5}'
258

This is an easier version of the above command line.

4.4 Tue Oct 30 jason@Yog-Sothoth 0: $ landscape-sysinfo --sysinfo-plugins=Processes | awk '{print $2}'
259

These one-liners print out the number of processes and are actually accurate. Very useful to have in a script.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.