Cannot kill process shown in parenthesis

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?


Solution 1:

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.

Solution 2:

This is a zombie process. Here's how to get rid of it from this answer on superuser:

Sadly, it appears that killing of zombies is all about killing the parent, and if the parent is /sbin/launchd, you can kill it only with rebooting.

It would be a Very Bad Idea to kill launchd, but you can tell it to HUP.

Try sudo kill -s HUP 1

That will cause launchd to reinitialize without restarting. This has worked for me in the past (wrt. removing zombie entries).