1

I am currently using this command to get some information about some specific processes:

ps -C beam.smp -o pid,user:20,%cpu,%mem,args

As I use it for two process names, I would like to do it in one command in order to get a snapshot. Like that:

ps -C beam.smp,docker -o pid,user:20,%cpu,%mem,args

The problem is that the output does not display a specific column with beam.smp or docker, which would be really useful for me. How could I get a new line in my output showing that?

3

Use the comm format specifier:

ps -C beam.smp,docker -o pid,user:20,%cpu,%mem,comm,args

This shows the command name, which is exactly what you're filtering on with the -C selector.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.