How to kill a process in state "T" (Terminated)

9,248

From your comment, you stopped the process with Ctrl-z (which is not the same as terminating).

If you want to kill the process, you have a few options

  1. Restore it to foreground and kill it.

Use these commands:

$ fg
Ctrl+c
  1. Kill it while stopped.

Just:

$ kill %
  1. For completeness-sake (although not specific to your question), you could also tell it to resume and work in background.

Commands:

$ bg   # for background
$ jobs # to see what is running in background (current shell)
Share:
9,248

Related videos on Youtube

runlevel0
Author by

runlevel0

Updated on September 18, 2022

Comments

  • runlevel0
    runlevel0 over 1 year

    this is a very specific question, I am sorry if there is a duplicate somewhere but I haven't been able to find it here or otherwise.

    In a server I have a process in state T (Terminated). I know I could use kill -9 <pid> but in this case the process would end up as a zombie and my sysadmin would complain.

    The program is obviously not doing anything but it's bit confusing as this particular process is very resource intensive so that we usually only start one instance. I am aware that the terminated one doesn't do anything but it would be nice to get rid of it. If it is not possible without the system restarting I will have to live with, no problem.

    TIA ;)