Top unix command ascending order

32.2k views Asked by At

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.

3

There are 3 answers

1
konsolebox On BEST ANSWER

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.

1
Édouard Lopez On

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)

2
Emmet On

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