Prabhu
Prabhu

Reputation: 404

How to count the java process of specific user in ps aux

Currently am executing this

ps aux | grep java

It is returning

root 4589 <some process>
user1 4218 <some process1>
user1 4248 <some process2>
user1 4258 <some process3>

Here how we can count the processes which is running by "user1"?

Upvotes: 0

Views: 1294

Answers (1)

John Zwinck
John Zwinck

Reputation: 249293

This is a bit more direct and should do what you want:

pgrep -u user1 java

Upvotes: 2

Related Questions