The basic ps command in Linux provides a display of all processes running on the system, including user IDs, CPU usage, memory usage percentage, etc. This information is accessed using the following steps:
- Browse the selection of programs and launch the resident terminal manager program to access the Linux shell.
- At the terminal manager command line, type the following:
$ ps aux
$ ps -ef -f
To identify processes that are consuming large amounts of memory, the sort command is used. Multiple fields are separated with a comma, and each field can be preceded with a “-” or “+” to sort the list in ascending or descending order. For demonstration, the following command also includes the CPU usage field:
$ ps aux –sort=+pmem,-pcpu
There are multitudes of other ways the ps command can dig for data, but these commands will help you quickly identify memory usage in linux applications and processes.