3

Just now, I encountered a bug in Google Chrome. For whatever reason, my Chrome tab, which was open to StackOverflow, created an infinite loop of "Are you sure you want to leave this page?" prompts.

I wanted to do a force-kill on terminal. But I had a hard time finding the PIDs for my Chrome application.

What is the simplest ps command (or any other command) to get the PIDs of your Chrome application on Mac OS X?

My best try was ps aux | grep '/Applications/Google Chrome.app' but I found the output hard to read. I would like to limit the columns to PID and command name.

0

1 Answer 1

3

To control which columns are in the ps output, use the options -o (add columns) or -O (set columns). A list of columns is provided by ps -L.

So, in this case, ps ax -o pid,comm (without arguments) or ps ax -o pid,args (with arguments).

To increase column width, specify the -w argument twice, e.g. ps axww -o pid,args.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .