xkill
systemLinux/Unix
The xkill command is one of the most frequently used commands in Linux/Unix-like operating systems. xkill Force close unresponsive X clients by killing their associated windows
Quick Reference
Command Name:
xkill
Category:
system
Platform:
Linux/Unix
Basic Usage:
xkill [options] [arguments]
Common Use Cases
Syntax
xkill [-button number] [-frame] [-id resource] [-all] [-display displayname]
Options
| Option | Description |
|---|---|
-button number |
Specifies the mouse button to use to select the window (default is 1, the left button) |
-frame |
If specified, xkill will kill the window that contains the pointer, not just the window directly under the pointer |
-id resource |
Specifies the X resource ID of the window to be killed |
-all |
Kills all windows on the screen |
-display displayname |
Specifies the X display to use (default is from the DISPLAY environment variable) |
Mouse Buttons
For the -button option, common values are:
| Value | Button |
|---|---|
1 |
Left button |
2 |
Middle button |
3 |
Right button |
Examples
How to Use These Examples
The examples below show common ways to use the xkill command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
Basic Examples:
Start xkill and select a window to close
xkill
Use the right mouse button instead of the left to select the window
xkill -button 3
Advanced Examples:
Force close a window by its resource ID (obtained from xwininfo)
xkill -id 0x1200001
Close all windows
xkill -all
Include window frame when closing a window
xkill -frame
Specify a display
xkill -display :0.1