macOS Terminal – Cannot Kill Process Shown in Parenthesis

bashmacosterminal

I started a rather long dd command that I would like to stop.

ps shows:

$ ps
  PID TTY           TIME CMD
 2006 ttys002    0:00.00 (dd)

The dd process is shown in parenthesis without the argument.

A kill produces no effect. Any idea on how to interrupt it?

Best Answer

The actual display of a process between (…) means this process was detached from its controlling terminal (here ttys002). This means that ^C, ^\, ^S, ^Z don't have anymore effect on it. It's behaving in daemon mode. This also means you can't send it a hangup either.

The correct way to deal with this case if unwanted, is to get the number of its parent process with:

ps lw | egrep '[ ](2006|PID)'

and kill it with a hangup signal:

kill -HUP xxxx

where xxxx is the process ID of the parent process.