Killing my software
Q: There is a window on my desktop that does not react. It does not even disappear when clicking the close-button.
This page started to wrap up a thread on the LBo mailinglist. We are not quite up to 50 ways to get rid of a program that would not behave, but the list is growing:
kill
ps ax | grep <prgname to get the PID of prgname. After that, we can kill <PID>. If that does not work, kill -9 <PID>
xkill
Start xkill (via terminal or your launcher) and click the window to kill. Powerfull. X11 only. Convenient.
killall
killall <prgname> or killall -9 <prgname> kills all the programs with that binary. Might not get the target since sometimes binaries are named differently than the application (OOo → soffice.bin and the like)
bash-script
It can even be put in a file called “actuallykill” (you can make the name shorter).
#bin/bash
ps aux | grep $1 | awk -F ' ' '{print $2}'| xargs kill
Make it executable and in your path. And then at the command line actuallykill keyword and it will kill all processes that contain keyword.
pgrep and pkill
From the manpage:
pgrep looks through the currently running processes and lists the
process IDs which matches the selection criteria to stdout. All the
criteria have to match. For example, "pgrep -u root sshd" will only
list the processes called sshd AND owned by root. On the other hand,
"pgrep -u root,daemon" will list the processes owned by root OR daemon.
pkill will send the specified signal (by default SIGTERM) to each process
instead of listing them on stdout.
This is a nice replacement for constructions like
"kill `ps ax|grep 'foo'|grep -v 'grep'|awk '{print $1}'` "
I found it here.
Copyright (c) by the authors.
Prior to editing, authors agreed to license their contributions by the terms of the GPL.
See our licensing page for details.
Linux® is a registered trademark of Linus Torvalds.
tutorials/advanced/realworld/killing_my_software.txt · Last modified: 2008/07/20 21:08
Welcome to LinuxBasics.org - The online community that helps people to get Linux installed and running.
During this tour, we will guide you through our website, which has many facets which wait to be explored
The biggest project we are running is our Linux course, based on the LBook.
The book is stored in wiki-format, which enables us to update and correct it as we go.
Discussion for the course is on our Forum
Our Forum is used for discussion of Linux and for questions and answers.
Search the mailing-list that was used prior to the Forum.
The questions and answers from the list are stored in the list's archives in order to help others with the same problems.
Every weekend, we meet to chat in IRC. These meetings are NOT mandatory, but are a nice chance to get to know each other better.
IRC is also a great tool to solve many problems, since it is very quick and easy to ask for more details if you need them.
The tutorials are one of the oldest sections on the LBo-website.
Here you find explanations on how to do specific tasks in Linux. Many of the tutorials were created after a certain problem
has been discussed (and usually solved :) on the mailing-list.
The tutorials are categorized in
In the links section, you find outbound links to other valuable resources.
One of our later additions to the site. We maintain a mirror of the Linux Documentation Project. This is our contribution to the "home of the HOWTOs"
Another later addition is the LBlog which focuses on how to do stuff on the Linux Desktop. It begins with the basics on installing Ubuntu.
Using the integrated site-search, you can search the tutorials, the LBook and all other wiki-pages
Simply type the search term into the box in the upper-right corner of our webpages
As a community, we depend on your feedback and collaboration. So, if you have something to share with others, please contact us. If you have a suggestion for a topic you would like to see covered here, please add it on the Wishlist.
There are many ways to contribute: You can answer questions on the Forum, you can write a complete tutorial or just a step-by-step documentation on how you completed a specific task using linux. Ask questions if the information on this site is not clear, tell us if we got something wrong, spell-check our writings, whatever.
We are looking forward to meeting you at LinuxBasics.org
Anita, Jisao, Sam and Stefan