Display the top ten running processes - sorted by memory usage

ps axo %mem,pid,euser,cmd | sort -nr | head -n 10
Sample Output
11.5  1957 lainme   firefox http://twitter.com/keyi_bu/status/256446157193093120/photo/1
 3.4  1813 lainme   /usr/bin/gnome-shell
 3.3  1867 lainme   /usr/bin/python2 /usr/bin/hotot-gtk3
 2.6  5183 lainme   conky
 1.5  1645 root     /usr/bin/Xorg :0 -br -verbose -auth /var/run/gdm/auth-for-gdm-3aSYDI/database -nolisten tcp vt8
 1.0  1854 lainme   pidgin
 1.0 18439 lainme   fcitx
 0.9  1998 lainme   /usr/lib/firefox/plugin-container /usr/lib/mozilla/plugins/libflashplayer.so -greomni /usr/lib/firefox/omni.ja 1957 plugin
 0.4  1821 lainme   nm-applet
 0.4  1785 lainme   /usr/lib/gnome-settings-daemon/gnome-settings-daemon

0
By: lainme
2012-10-12 03:27:26

4 Alternatives + Submit Alt

  • ps returns all running processes which are then sorted by the 4th field in numerical order and the top 10 are sent to STDOUT. Show Sample Output


    105
    ps aux | sort -nk +4 | tail
    root · 2009-01-23 17:12:33 136

  • 5
    ps aux --sort -rss | head
    unixmonkey42657 · 2012-11-14 17:47:50 2
  • Display the top processes sorted by memory usage. This is mostly useful because it's easy to remember and can give me a quick 'top' view of a group of servers when used over pssh. (Though I'd recommend |head -10 to minimize the output). Show Sample Output


    0
    top -b -o +%MEM |head -17
    dak1n1 · 2016-03-16 22:14:34 3
  • This command is better for just displaying the memory in KiB. Show Sample Output


    0
    ps -eo size,command --sort -size | head
    bracourt · 2016-09-30 20:03:21 3

What Others Think

Die Villa Roma ist nicht zuletzt aufgrund ihrer exklusiven Nachtclub-Atmosphäre und ihrer 5-Sterne-Erotik ein ganz besonderes Bordell in München. Ihr Aufenthalt bei uns am Frankfurter Ring fängt mit einer herzlichen Begrüßung an. Bordell München
villaroma1 · 10 weeks and 4 days ago
We started True People Check because we saw a significant need for high-quality open source intelligence (OSINT) in the insurance industry.social media investigation company
truepeoplecheck1 · 10 weeks and 2 days ago
SHOPPING FOR THE RIGHT TRAINING GEAR SHOULDN’T BE AS HARD AS YOUR WORKOUTS. TAKE ADVANTAGE OF THESE RECENT UPDATES FOR YOUR BEST SHOPPING EXPERIENCE. www.thesportstation.co.uk">cast iron kettlebells
thesportstation1 · 7 weeks and 3 days ago
Moving your property office may be pretty the obstacle for those getting into their new domestic. There are such a lot of factors to think about it is often tough to hold it immediately. Well, when it comes to shifting in Arizona all of us recognise our stuff so permit us to shed a touch light on the evil business of relocating a home workplace. http://nicolosimovers.com/">tucson movers
nicolosimovers1 · 6 weeks and 6 days ago
DIMO is one of most professional manufacturers with rich experience in producing bathroom mirrors,especially LED bathroom mirrors and illuminated mirror cabinets. Through 12 years development, we have owned two factories in city of Shaoxing and Hangzhou. hotel led bathroom mirrors
bathroomled · 6 weeks and 6 days ago
L’actualité sur le monde des enchères, du design, de la déco et objets rares. Des histoires insolites et une sélection de belles choses à vendre. fauteuil barcelona occasion
auctionlab1 · 2 weeks ago
Vi erbjuder tuningvärldens bästa programvaror och custommaps till dom flesta bilar. För andra modifieringar, kontakta oss! bsr
boosttuning · 6 days ago
Nice and good post If it's not too much trouble, guarantee that you have checked every one of the reports and that you are 100% happy with them. Also, do ask about the endorsed NOC of the lodging society by the concerned specialists. Bahria town Lahore Along these lines, the fulfillment of the clients can be guaranteed.
victoria12 · 4 days ago
Kitchen renovation is viewed as an expensive engagement, forcing most homeowners to seek ways of reducing costs. One of the things that people often do is to eliminate the services of a kitchen designer during a renovation process. green kitchen cabinets
cabinetdiy · 1 day ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: