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?

2
  • 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>. Apr 8, 2013 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. Mar 29, 2017 at 18:50

2 Answers 2

53

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

3
  • 4
    Even better if you run it from Alt-F2 so that you don't need a terminal window.
    – colan
    Jun 26, 2014 at 1:08
  • Very nice, very nice Feb 12, 2021 at 14:10
  • I had a popup that didn't go away with xkill. Restarting gnome helped Alt-F2 r
    – umpirsky
    May 24, 2022 at 11:57
2

You can also use the sequence Ctrl+Alt+Esc

1
  • 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, 2018 at 14:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .