how to sort mem process using ps command

Kaushal Shriyan kaushalshriyan at gmail.com
Fri Jul 14 11:42:33 UTC 2006


On 7/14/06, Roberto Ragusa <mail at robertoragusa.it> wrote:
> Kaushal Shriyan wrote:
>
> > I didnot hear from you on my query for
> >
> >> using this command "ps ww -e --sort -rss o
> >> pid,pmem,command,rss,size,vsz|head -20"
> >> I want to check which user is hogging more memory
>
> I don't know if
>
>  ps ww -e --sort -rss o user,pid,pmem,command,rss,size,vsz|head -20
>
> is enough for you.
> It will show the processes hogging more memory and the user they
> belong to.
>
> Maybe you want something different: the sum of all the processes
> belonging to one user. In that case I think a little script is needed.
> Here is my ugly attempt:
>
>  ps ww -e --sort -rss o user=,rss=,pid=,pmem=,command=,size=,vsz=\
>  |(sort; echo)\
>  |gawk '{if ( lastuser == $1 ) {tot=tot+$2} \
>   else {printf "%9i %s\n",tot,lastuser; tot=$2}; lastuser=$1 }'|\
>  sort -nr
>
> Best regards.
> --
>   Roberto Ragusa    mail at robertoragusa.it
>
> --
> fedora-list mailing list
> fedora-list at redhat.com
> To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
>

Thanks Robert
You added user in the command it worked

ps ww -e --sort -rss o user,pid,pmem,command,rss,size,vsz|head -20

Thanks :))




More information about the users mailing list