Kill ­ a Tutorial Quick Reference for Desktop Users

Kill ­ a Tutorial Quick Reference for Desktop Users

3/28/2017 kill ­ A Tutorial Quick Reference for Desktop Users kill (terminate a process) The kill command terminates a process. Call it like this: kill PID The argument PID is the process ID of the program you want to terminate. You can display processes' ID numbers by running →ps. kill has a cousin that lets you terminate programs by name. It's called pkill and is invoked like so: pkill PATTERN This will kill all processes whose name matches the regular expression PATTERN. For example, pkill fire will kill firefox, firestarter etc. Be careful with this command. Before executing it, you should check which processes match PATTERN by running pgrep ­l PATTERN (see the section on →ps). Saying that kill terminates processes is a simplification. The underlying mechanism is that kill sends signals to processes. By default, kill sends the signal 15, named SIGTERM, which kindly asks a process to terminate itself. There are many more signals. Sometimes a process won't terminate itself on receiving SIGTERM due to a malfunction. In that case, you can send it the signal 9, named SIGKILL, like this: kill ­9 PID This is a harsh way of terminating a process that deserves the name “killing”. It terminates the process abruptly without giving it the opportunity to do clean­up work, so it should only be used when the process doesn't respond to SIGTERM. Signals are ubiquitous in Linux. Remember the keyboard shortcuts Ctrl­c (terminate a process) and Ctrl­z (pause a process) from Chapter 1? They send the signals SIGINT and SIGTSTP respectively. If you want to learn more about signals, run →man 7 signal, but note that the important signals have been covered in this section. In 99% of all cases you'll use kill to send SIGTERM (kill's default action) or SIGKILL (kill ­9). The command xkill specializes in killing graphical programs. When you run it, your mouse pointer will turn into a cross hair or skull and crossbones. Click on any window to terminate the underlying application. xkill works differently from kill. It does not send signals but tells the X server, which manages graphical programs, to close the connection to a client program. https://linux­shell­commands.jimdo.com/4­managing­processes/kill/ 1/1.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    1 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us