Re: how to sort mem process using ps command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux