Top running process in Linux by CPU and RAM , you are around Linux System Administration or even casually using it and want to know whats taking up most of your system resources, below is the command.
root@ETHICALHACKX:~# ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head PID PPID CMD %MEM %CPU 1248 1168 /usr/bin/gnome-shell 6.3 2.7 3405 1 /opt/google/chrome/chrome - 5.7 1.3 19888 3415 /opt/google/chrome/chrome - 4.2 11.1 3435 3405 /opt/google/chrome/chrome - 3.3 3.6 19702 3415 /opt/google/chrome/chrome - 3.2 5.5 4055 1 telegram-desktop -- tg://jo 3.2 1.4 19865 3415 /opt/google/chrome/chrome - 2.8 1.5 20045 3415 /opt/google/chrome/chrome - 2.3 1.3 20178 3415 /opt/google/chrome/chrome - 2.2 1.3 root@ETHICALHACKX:~#
Why we are discussing this is because covering the very usual things for Linux for hackers ends with not much of knowledge. We thought better equip with real-life usage which will take us closer to understanding Linux.
We will take a bit more to understand the above command.
-o argument lets you decide the output of ps command
ppid are for process id and name associated with cmd
%mem for CPU and RAM utilisation
--sort to sort by CPU or RAM usage and
-%mem for descending order of memory usage
We will discuss more on Linux in further post to make your terminal life easier.