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.
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.
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.
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.
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
.
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
.
sudo apt-get install htop
htop
Actions are available through F1 to F10 keys.
(cc licence)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With