Sorting the users logged in according to the number of processes

Is it possible to get a list of users sorted by the number of processes executed by each.
I have a HP - UX server with 2800 processes running currently.
And I want to know the number of processes owned by each person logged in to that server.something like below:
user1 : 150 Processes
user2 : 75 "
.............................

..............................
user100: 50

I tried using ps -aef and sorting but got stuck up.
Any one please help me.

ps -ef | grep -c root

says 80, meaning 80 processes started/owned by root. Something like that ?

UNIX_STD=1995 ps -eo user|sort|uniq -c|sort -nr

Sorry, I was missing the last sort :slight_smile: