Find Top Processes using Highest Memory and CPU in Linux

If we want to find  the top processes in linux consuming memory and cpu then we can use below command.

ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head


For a specific process id

 ps -Lo s,lwp,class,pri,psr,tty,user,pcpu,time,pmem,vsz,rss,args --sort=pcpu -p <pid>

S   LWP CLS PRI PSR TT       USER     %CPU     TIME %MEM    VSZ   RSS COMMAND
S 19497 TS   19   3 ?        oraasm    0.0 00:00:05 36.5 7315196 5900868 /asm/oracle/asmdb/12.1.0/grid/bin/ocssd.bin
S 19521 TS   19   3 ?        oraasm    0.2 23:57:51 36.5 7315196 5900868 /asm/oracle/asmdb/12.1.0/grid/bin/ocssd.bin
S 20433 TS   19   0 ?        oraasm    0.0 00:00:00 36.5 7315196 5900868 /asm/oracle/asmdb/12.1.0/grid/bin/ocssd.bin
S 20440 TS   19   3 ?        oraasm    0.0 00:00:00 36.5 7315196 5900868 /asm/oracle/asmdb/12.1.0/grid/bin/ocssd.bin
S 20441 TS   19   0 ?        oraasm    0.0 00:00:00 36.5 7315196 5900868 /asm/oracle/asmdb/12.1.0/grid/bin/ocssd.bin
S 20446 TS   19   2 ?        oraasm    0.0 00:07:26 36.5 7315196 5900868 /asm/oracle/asmdb/12.1.0/grid/bin/ocssd.bin
S 20449 TS   19   0 ?        oraasm    0.0 00:07:40 36.5 7315196 5900868 /asm/oracle/asmdb/12.1.0/grid/bin/ocssd.bin
S 20450 TS   19   3 ?        oraasm    0.0 00:00:00 36.5 7315196 5900868 /asm/oracle/asmdb/12.1.0/grid/bin/ocssd.bin








If you like please follow and comment