Getting information about the most resource-hungry Linux processes is very easy with the command line.
This example will print the top 10 most resource-hungry Linux processes.
(jcartwright@2403-4800-25af-b00--2) 192.168.1.5 Doom $ ps aux --sort=-%cpu | head -n 11 | awk 'NR>1 {printf "%-8s | %-5s\n", $11, sprintf("%.2f", $3) "%"}' /tmp/.mount_Gqrx-2jwH15W/AppRun.wrapped | 45.80% /usr/lib64/firefox/firefox | 8.20% /usr/libexec/Xorg | 6.00% /usr/lib64/firefox/firefox | 2.30% /usr/libexec/baloo_file | 2.20% /usr/lib64/firefox/firefox | 2.00% /usr/lib64/firefox/firefox | 1.40% /usr/bin/pulseaudio | 1.10% xfwm4 | 0.70% /usr/lib64/firefox/firefox | 0.70% |
This command does the following:
ps aux --sort=-%cpu
: Lists all processes sorted by CPU usage in descending order.head -n 11
: Takes the top 10 processes (plus the header line).awk 'NR>1 {printf "%-8s | %-5s\n", $11, sprintf("%.2f", $3) "%"}'
: Skips the header line (NR>1
) and formats the output to show the process name and CPU usage in a simple text-based bar graph format.
For a more detailed and interactive graphical representation, htop
remains the best option.
But, this is a fast way to get an idea of the most resource-intensive processes on your Linux system.
This is another way to do this with ps. List the top 20 processes using the most memory.
(jcartwright@2403-4800-25af-b00--2) 192.168.1.5 Doom $ ps -ef --sort -rss | head -n 20 | awk '{print $1, $2, $3, $4, $5, $6, $7, $8}' UID PID PPID C STIME TTY TIME CMD jcartwr+ 2387 2074 3 07:25 ? 00:06:56 /usr/libexec/baloo_file jcartwr+ 3003 2805 2 07:36 ? 00:04:17 /usr/lib64/firefox/firefox jcartwr+ 2805 2199 7 07:36 ? 00:16:48 /usr/lib64/firefox/firefox jcartwr+ 19957 2805 0 10:30 ? 00:00:18 /usr/lib64/firefox/firefox jcartwr+ 20226 2805 2 10:35 ? 00:00:46 /usr/lib64/firefox/firefox jcartwr+ 19538 2293 46 10:27 ? 00:18:48 /tmp/.mount_Gqrx-2jwH15W/AppRun.wrapped jcartwr+ 20783 2805 0 10:36 ? 00:00:09 /usr/lib64/firefox/firefox jcartwr+ 22839 2805 1 11:05 ? 00:00:02 /usr/lib64/firefox/firefox mdatp 1904 1237 0 07:24 ? 00:00:01 /opt/microsoft/mdatp/sbin/wdavdaemon root 1237 1 0 07:23 ? 00:00:23 /opt/microsoft/mdatp/sbin/wdavdaemon jcartwr+ 2930 2805 0 07:36 ? 00:00:04 /usr/lib64/firefox/firefox jcartwr+ 2602 2551 0 07:25 ? 00:00:00 /usr/bin/akonadi_archivemail_agent jcartwr+ 2669 2551 0 07:25 ? 00:00:00 /usr/bin/akonadi_unifiedmailbox_agent root 1958 1952 7 07:24 tty1 00:15:48 /usr/libexec/Xorg jcartwr+ 2668 2551 0 07:25 ? 00:00:01 /usr/bin/akonadi_sendlater_agent jcartwr+ 2610 2551 0 07:25 ? 00:00:00 /usr/bin/akonadi_mailfilter_agent jcartwr+ 2206 2074 0 07:25 ? 00:00:00 kalendarac jcartwr+ 2426 2074 0 07:25 ? 00:00:25 /usr/libexec/tracker-miner-fs-3 jcartwr+ 3762 2199 0 07:43 ? 00:00:14 audacious |