Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Top unix command ascending order [closed]

Tags:

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.

like image 460
Death Metal Avatar asked Sep 02 '13 19:09

Death Metal


People also ask

How do I sort ascending order in Unix?

In Unix, when you try to sort a file in a numeric way, you can use the option '-n' with the sort command. This command is used to sort the numeric contents present in the file. Be default, it sorts in ascending order.

What is top command used for in Unix?

top command is used to show the Linux processes. It provides a dynamic real-time view of the running system. Usually, this command shows the summary information of the system and the list of processes or threads which are currently managed by the Linux Kernel.

How do you exit top command?

top command option to quit session You need to just press q (small letter q) to quit or exit from top session. Alternatively, you could simply use the traditional interrupt key ^C (press CTRL+C ) when you are done with top command.


Video Answer


2 Answers

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.

like image 153
konsolebox Avatar answered Oct 02 '22 17:10

konsolebox


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)

like image 28
Édouard Lopez Avatar answered Oct 02 '22 15:10

Édouard Lopez