20

I've been running some Python scripts to graph some stuff and occasionally I'll lose track of what windows it spawned and just kill it with ^Z. However, unlike in Windows, the associated windows don't die; they stick around and cannot be closed.

These windows seem clueless; they don't redraw after being minimized or resized. I'm new to the Linux env so I can't fully articulate what's going on, but in any event, how do I get rid of these zombie-orphan-hobo windows?

Nick T
  • 2,483
  • Assuming that you run these scripts from a terminal, you can always type exit and the process(es) should quit automatically (at least with my experience). Also, you can use the ps -A command and then type sudo kill <process id here>. – Alex Spataru Apr 08 '13 at 22:28
  • 2
    ^Z doesn't kill a Linux process. It just suspends it. ^C should be your first choice. When you have to resort to ^Z to regain control of the terminal, you should kill the suspended job, to free up the resources it's still using. It won't die with any signal other than SIGKILL while it's suspended. "bg" will thus be useful to let the child die. xkill's nice and easy to use but it doesn't actually kill the process either. A well-behaved program, one that isn't stuck eg because it's been suspended, will exit when its X connection is closed by xkill. – Martin Dorey Mar 29 '17 at 18:50

2 Answers2

53

You can use xkill in the command line, which allows you to click an open window to kill the process.

Basharat Sialvi
  • 24,046
  • 8
  • 62
  • 82
Eric
  • 788
2

You can also use the sequence Ctrl+Alt+Esc

abu_bua
  • 10,783
  • By default it is set to Switch system controls directly at least in my system and one installed in VMWare(both are 18.04 LTS). You might like to add how to redefine that shortcut. – Kulfy Sep 28 '18 at 14:50