Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question is related to a question I posted on rogue firefox procesess. It relates to firefox processes following image uploads that I have been having for a while.

I am trying to get to the second field of the ps command with the following set of pipes, so that I can kill the processes from the command line quickly:

ps aux| grep fire|cut -f 2

However this produces the wrong output as it shows the whole line of ps.

I know that the default delimiter for cut is tab

I have also tried:

ps aux| grep fire|cut -f 2 -d \t

From this question on stackoverflow I know that

ps axu | grep '[f]irefox' | awk '{print $2}'

gives me the output I want.

I want to understand why my two versions of cut are not working, and can it be made to work piping ps to grep and then to cut and getting to the second column (ie. the process IDs).

share|improve this question
up vote 3 down vote accepted

ps does not use Tabs to separate column (run ps aux > foo; vi foo to verify). As an alternative you can cut on character level by running

kill $(ps aux | grep fire | cut -c 17-23)

Or you can also just run

pkill fire

(or pgrep fire to see which processes would match)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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