Top unix command ascending order

26,207

Solution 1

Using F you'd get you to the menu of fields. Using s would set what field would do the sorting. Press ESC to escape from the menu then to change Ascending/Descending mode, use R.

Solution 2

Did you have a look at other utilities ? I personally like htop which I found more friendly and easy to use than the traditional top.

Install

sudo apt-get install htop

Run

htop

Actions are available through F1 to F10 keys.

Preview

Htop showing a computing load (cc licence)

Solution 3

If you type ? in top, it gives you help that tells you that R toggles the sort order.

Share:
26,207
Death Metal
Author by

Death Metal

I do research in Public health domain using Bioinformatics skills and knowledge. My research focuses on human genetics. My profile allows me to put on multiple hats to learn R, word, power point, excel, git and many other things. Of most I use R (ggplot2) and bash environment religiously. Over the years I've developed skills of IT administration (tool installation), version controls of different software among various other tricks needed in my line of job without bugging the IT guy. Past web experience: jQTuery, AJAX, JS, Laravel, MySQL, HTML, CSS, PHP, JSPs, Java Servlets, Noob in languages: R, C Languages equipped with: Bash, Python, Biopython Have worked in: Java, Perl, BioPerl Packages: Excel, Word, and Powerpoint Testing experience: Worked with HP Quality Center, Toad

Updated on September 03, 2020

Comments

  • Death Metal
    Death Metal over 3 years

    I am using Ubuntu 12.04 and have recently started working on bash. I need to display say memory or CPU in ascending order.

    command : top

    shift F, this shows window of all the column. I select n for memory and it is ordered in descending order. Same thing goes with CPU. I am unable to display these in ascending order. I have tried with shift O, O, R, shift R, P.

    • neverMind9
      neverMind9 over 5 years
      Why not move this to Unix.StackExchange.com?
  • Death Metal
    Death Metal over 10 years
    with Shift+r, I can see processes related to only user, it doesn't display of root. Also, it shows all 0, 0, I cannot understand why.
  • Death Metal
    Death Metal over 10 years
    @ konsolebox and Edourad Lopez - thank you very much for usage of R and htop installation.
  • SpinUp __ A Davis
    SpinUp __ A Davis almost 7 years
    Unlike h, this works in both BSD and GNU top