24

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.

Charles
  • 50,943
  • 13
  • 104
  • 142
Death Metal
  • 830
  • 3
  • 9
  • 26

3 Answers3

39

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.

konsolebox
  • 72,135
  • 12
  • 99
  • 105
8

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)

Édouard Lopez
  • 40,270
  • 28
  • 126
  • 178
6

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

Emmet
  • 6,192
  • 26
  • 39