HowTo: Linux / Unix Kill X Window Halted, Frozen or Resource Eeating Application

by on September 18, 2006 · 2 comments· LAST UPDATED November 6, 2012

in , ,

How do I kill X Window system application that is eating system resources and can not killed from local or remote X sever?

You need to use xkill command. It kills a client by its X resource and not by process ID. For example, your application may not be responding kill request. Even if you try to kill you see application window.
Tutorial details
DifficultyEasy (rss)
Root privilegesNo
RequirementsX.org / xkill
Estimated completion timeN/A

xkill is a utility for forcing the X server to close connections to clients. This program is very dangerous, but is useful for aborting programs that have displayed undesired windows on a user's screen.

Open a terminal type the following command:
$ xkill

By default xkill will display a special cursor with which you should select a window to be kill. Click on the application which you want to abort forcefully or select the X window / application whose client you wish to kill with button 1. If a pointer button is pressed over a non-root window, the server will close its connection to the client that created the window.

How do I kill the application using the X identifier?

An easy way to find out the id of a window, is running a command like:
$ xwininfo
You need to select target window with the mouse to get information about windows. Here, is a sample output from my gnome-terminal window:

 
xwininfo: Please select the window about which you
          would like information by clicking the
          mouse in that window.
 
xwininfo: Window id: 0x6e4c0a7 "vivek@wks01: ~"
 
  Absolute upper-left X:  2443
  Absolute upper-left Y:  231
  Relative upper-left X:  2443
  Relative upper-left Y:  231
  Width: 983
  Height: 636
  Depth: 32
  Visual: 0x104
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x6e00003 (not installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +2443+231  -414+231  -414-333  +2443-333
  -geometry 80x24+2443+231
 

Note down the window id # 0x6e4c0a7. You can also use the following syntax:

 
xwininfo | awk '/Window id:/ {print $4}'
 

Sample outputs:

0x6e4c0a7

Finally, run xkill command as follows:

 
xkill -id 0x6e4c0a7
 
TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 2 comments… read them below or add one }

1 sentsent July 4, 2012 at 6:55 am

this command is cool!!!

Reply

2 Alex Muraro November 6, 2012 at 11:01 am

best command ever :)

Reply

Leave a Comment

Tagged as: , , , ,

Previous Faq:

Next Faq: