Score:0

Running ps command with 'Irix mode' off

cl flag

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
Cyrus avatar
in flag
Please add your desired output (no description, no images, no links) for that sample input to your question (no comment).
Asem Abuelhija avatar
cl flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.