Counting the number of processes running in Linux


Option 1: Number of processes run by a lsdyna_smp_s_r1

Sometimes we need to get the number of processes run by a lsdyna_smp_s_r1. For example if you are running a software named lsdyna_smp_s_r1 and you want to know how many processes were spawn, you can use the command

# ps -C lsdyna_smp_s_r1 | wc -l
183

OR if you are checking for the number of processes for SSH

# pgrep lsdyna_smp_s_r1 | wc -l
183

Option 2: Number of processes run by a User

# ps -U user1 | wc -l
333

 

One thought on “Counting the number of processes running in Linux

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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