Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-28-2006, 11:21 PM   #1
Registered: Jul 2005
Posts: 41

Rep: Reputation: 15
ps 101

Does anyone know how can i use the ps command to check which process is using up most of my memory.

I remember i could do it before but i just cant remember right now.

I remember I was able to use ps to show processes that is taking up say more than 10 Mb of memory.
Old 05-29-2006, 02:04 AM   #2
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Something like:

ps aux | grep -v '^USER' | awk '$5 > 10000 {print}' | sort -r -n -k 4
should do it. Or just fire up top and hit M (capital 'm') to have it sort the processes by memory usage.

Edit to add: There's also a -O (for order) flag to ps to sort by memory size so you don't necessarily have to call sort separately.

Last edited by btmiller; 05-29-2006 at 02:08 AM.
Old 05-29-2006, 05:20 AM   #3
Registered: Jul 2005
Posts: 41

Original Poster
Rep: Reputation: 15
Thx for the advise with awk.

awk is useful, yet its kind of annoying/hard to use for newcomers.

This is what i came up with after using btmiller's advise.


ps -eo "pid time comm sz" --sort vsz | awk '$4 > 50000 {print}'
thanks again~


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
ZyAIR B-101 dnelson Linux - Wireless Networking 5 04-06-2004 05:50 PM
Ram 101 brandonweinberg Linux - General 3 02-07-2004 09:15 PM
Wine 101 thebatgranny Linux - Software 8 10-13-2003 12:58 PM
Netwoking 101 Romulan Linux - Newbie 0 09-17-2003 06:54 PM
Samba 101 avatarpalin Mandriva 2 09-04-2003 08:51 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:13 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration