UNIX Hints & Hacks |
|||||||||||||||||||||||||||||||||||||
Chapter 7: Displays and Emulations |
|
||||||||||||||||||||||||||||||||||||
|
There is a way to kill an actual resource, which is quite a bit different from killing a process.
Flavors: AT&T, BSD
Syntax:
xkill
The command xkill doesn't kill an entire X session but it does kill a client by the X resource that is attached to it.
% xkill
When xkill is executed it displays a unique cursor that is a prompt to the user to select a window to be killed. This is a great way to kill the windows that the regular kill command doesn't close after you kill their PID. Yes, if you kill the PID of a process that opens another window, it should close it. The reality is that sometimes it doesn't. Using xkill is one more way to clean up your X session without reinitializing X.
The types of windows that can be killed can be opened by applications or xterms. They are not specific to any one type of window. If a nonroot window is clicked on, the server closes its connection to the client that created the window. If you run the xcalendar program and click on a day to add data to, a new window appears. If xkill is executed and you click on the parent window or the window that relates to a specific calendar date, both windows will be killed, not simply the parent window or the child window.
Warning - A premature click of the button can kill an important window by mistake. Make sure that the window is in the foreground when it is killed. |
The method of killing windows with xkill makes it easy to not have to worry about the process IDs that are associated with the window or the process that is controlling it.
There are occasions when you have a window that will not die from a remote X server displayed on your local workstation. Even if you can kill the process on the remote server, the window still doesn't disappear. The xkill is your last chance to get rid of the window. Keep in mind that, in certain situations, the window might die with the use of the xkill command but this doesn't mean that the process exits and dies as well. There is still a chance that the process will be left in a zombie state even after the window is gone. Whenever possible, always confirm the window's process ID both before and after the xkill is fully executed.
Man page:
xkill
UNIX Hints & Hacks |
|||||||||||||||||||||||||||||||||||||
Chapter 7: Displays and Emulations |
|
||||||||||||||||||||||||||||||||||||
|
© Copyright Macmillan USA. All rights reserved.