The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 04-22-2009
reddybs reddybs is offline
Registered User
  
 

Join Date: Jan 2009
Location: Sriharikota-AP-India
Posts: 53
Quote:
Originally Posted by yoavbe View Post
Hi,

When running top on linux redhat machine , i see that i have 16gb of memory
in my machine and about 14.5gb of memory are in use:

Mem: 16395780k total, 14970960k used, 1424820k free, 370264k buffers
Swap: 4192956k total, 25824k used, 4167132k free, 12029400k cached

How can i sum the size of memory in use by USER.

Thanks
Yoav
Hello,

Try this command:
Code:
ps aux | awk '$1 == "reddybs" {sum +=$4}; END {print sum}'
reddybs is the user name.

OR

When you execute top command, press u and then type the username.
This will give you top processes owned by the user.

Cheers,
Sai