Linux: Process List Sorted by Memory Usage

Objective: List running processes on Linux and sort them by memory usage.

To view running processes, we use the ps command. To list processes together with memory utilisation / usage, run ps command with the following syntax.

To sort the processes according to memory usage, I was initially using the following syntax, which is the wrong way.

The output of ps is sorted based on the 4th field (memory usage field). Note that the header field is no longer available.

The proper way to sort based on memory usage is by using the following syntax. Processes with the largest RSS sizes will be at the top.

To sort in reverse order, that is to print processes with the largest RSS value at the bottom, use the following syntax. The “-rss” option has to be replaced with “rss“.

ibrahim = { interested_in(unix, linux, android, open_source, reverse_engineering); coding(c, shell, php, python, java, javascript, nodejs, react); plays_on(xbox, ps4); linux_desktop_user(true); }