Ben Chuanlong Du's Blog

It is never too late to learn.

Sort top by CPU or Memory Usage

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

By default the result of the top command is sorted by CPU usage on Linux. The table below list options to sort the result of the top command by different criterias on Linux and macOS

Linux macOS
Sort by CPU usage top top -o cpu
Sort by Memory usage top -o %MEM top -o mem

Note: The above table is generated with the help of TableConvert Online.

Comments