0

I know that within the interactive 'top' screen, I can press 'Shift + i' to turn off 'Irix mode'

Is there a way to do the same thing with 'ps' command?

I am trying the below mini script to print out the top 10 processes that are consuming the CPU, but I want the CPU value to be relative to all cores.

[root@jo00-sat01 ~]# ps -eo pcpu,pid,args,user | (read -r; printf "%s\n" "$REPLY"; sort -k 1 -r -n) |head -11
%CPU   PID COMMAND                     USER
32.8 30748 /opt/process/bin/script     root
14.0 49707 /usr/bin/perl /opt/rrd      rrd
 4.6 49664 sshd: root@pts/0            root
 2.0 49698 /usr/sbin/CROND -n          root
 1.7 49650 postgres: autovacuum worker postgres
 1.7 12736 /usr/lib/jvm/jre/bin/java - tomcat
 1.3 47354 Passenger RackApp: /usr/sha foreman
 1.2 49467 postgres: autovacuum worker postgres
 1.2 38915 /opt/rh/rh-mongodb34/root/u mongodb
 1.0 49704 /bin/sh -c /usr/bin/perl /o rrd
  • Please add your desired output (no description, no images, no links) for that sample input to your question (no comment). – Cyrus Jan 14 '22 at 22:58
  • I need the output exactly as it's shown in the original question, only that the CPU value is relative to one virtual CPU (or core) , in other words it can go over 100%. I need to fix that. – Asem Abuelhija Jan 18 '22 at 12:31

0 Answers0