Skip to Content
Linux Shell Scripting Cookbook - Third Edition
book

Linux Shell Scripting Cookbook - Third Edition

by Clif Flynt, Sarath Lakshman, Shantanu Tushar
May 2017
Beginner
552 pages
28h 47m
English
Packt Publishing
Content preview from Linux Shell Scripting Cookbook - Third Edition

How to do it...

  1. The kill -l command will list the available signals:
        $ kill -l
        SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP
        ...
  1. Terminate the process:
        $ kill PROCESS_ID_LIST

The kill command issues a SIGTERM signal by default. The process ID list is specified with spaces for delimiters.

  1. The -s option specifies the signal to be sent to the process:
        $ kill -s SIGNAL PID

The SIGNAL argument is either a signal name or a signal number. There are many signals available for different purposes. The most common ones are as follows:

  • SIGHUP 1: Hangup detection on the death of the controlling process or terminal
  • SIGINT 2: This is the signal emitted when Ctrl + C is pressed
  • SIGKILL 9: This is the signal used to forcibly kill ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Linux Shell Scripting - Second Edition

Mastering Linux Shell Scripting - Second Edition

Mokhtar Ebrahim, Andrew Mallett

Publisher Resources

ISBN: 9781785881985