I'm trying to get CPU usage of a process by,ps -p 12990 -o comm=comm,pcpuBut that only print the command name (the process does exist), what's wrong with it?
-p and -o comm doesn't work together?
ps
ps -p 12990 -o comm,pcpuwill show the %CPU and COMMAND columns for the process with PID 12990.-o comm=comm,pcpu is being interpreted by your ps as output the comm column, but rename the header comm,pcpu.*If you explicitly want the comm header to be comm, you'll either need to use two -o flags:ps -p 12990 -o comm=comm -o pcpuor put the renamed comm column at the end of the -o argumentps -p 12990 -o pcpu,comm=comm*From the ps(1) man page:The behavior of ps -o pid=X,comm=Y varies with personality; output may  be one column named X,comm=Y or two columns named X and Y. Use  multiple -o options when in doubt.