Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am doing it to, I prefer numbering theme as opposed to holding the shift key and typing the whole signal name I was just showing that there's no difference, so everything is clear.
kill(1), without any switches, defaults to kill -15, which signals the process to shut itself down. This is generally the perferable way of shutting down a process, since the process will close all opened files, shutdown down any child processes, and return all resources back to the system. The problem is that not all processes are written to catch signal 15. In those cases, and cases in which a process may get hung up in a loop, you would use kill -9. In this case, the kernel is doing an immediate shutdown of a process. This form of killing is done as a last resort, since not all resources may be returned to the system. -mk
kill `ps -e | awk '/<process-name>/{print $1}'` This is useful because you don't have to know the pid or the exact name of the process. Ex. To kill mozilla, you would do kill `ps -e | awk '/mozilla/{print $1}'`
When I don't know a process pid, I prefer pkill. I rather use signal names instead of number, because I have doubts all the time. With names, I won't make a mistake
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.