Discrepancies between "ps -f" and "ps"

We are running Red hat Enterprise 7.7 (Maipo) and for a specific oracle process I'm getting two different values under "CMD" column. See below examples:

ps -p [process_id]
109401 ? 00:09:57 ora_pmon_test

And:

ps -f -p [process_id]
oracle 109401 1 0 2019 ? 00:09:57 ora_pmon_test01

I have put sample names, but basically "CMD" for the first output is truncated. What is the difference of these two ways of running the ps command?

What do these two outputs represent?

1 Answer

In the first case you're seeing the comm column, which is stored as a separate field in the process (/proc/PID/comm) and is limited to 16 bytes.

In the second case you're seeing the command aka cmd aka args column, which is taken directly from the process' command line (/proc/PID/cmdline) and has no such limit.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like