Vidi Vidi - 25 days ago 5x
Linux Question

The number of processes a user is running using bash

I would like to know how I could get the number of processes for each user that is currently logged in.
Thank you.


Give this a try:

ps -u "$(echo $(w -h | cut -d ' ' -f1 | sort -u))" o user= | sort | uniq -c | sort -rn