kill & pkill & killall Flashcards
kill
Send the processes identified by PID or JOBSPEC the signal named by SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then SIGTERM is assumed.
kill
<pid></pid>
- <signal></signal>
- s <signal></signal>
–signal <signal></signal>
<pid>, Send a signal to every <pid> listed.</pid></pid>
- <signal></signal>
- s <signal></signal>
–signal <signal></signal>
Specify the signal to be send. The signal can be specified using a nam of number.
kill
- l
- L
- l, –list [signal], List signal names. This option has an optional argument, which will convert signal number to signal name, or other way round.
- L, –table, List signal names in a nice table.
Signals
1
2
3
4
5
1) SIGHUP
2) SIGINT
3) SIGQUIT
4) SIGILL
5) SIGTRAP
Signals
6
7
8
9
10
6) SIGABRT
7) SIGBUS
8) SIGFPE
9) SIGKILL
10) SIGUSR1
Signals
11
12
13
14
15
11) SIGSEGV
12) SIGUSR2
13) SIGPIPE
14) SIGLARM
15) SIGTERM
pkill
pkill looks through the currently running processes and will send the specified signal (by default SIGTERM) to each process that matches the criteria.
pkill
- e
- c
- f
- g
- G
- i
- e, –echo, Display what is killed.
- c, –count, Count of matching processes.
- f, –full, Use full process name to match.
- g, –pgroup <pgid>, Match listed process group IDs.</pgid>
- G, –group <gid>, Match real group IDs</gid>
- i, –ignore-case, Match case insensitively.
pkill
- n
- o
- P
- s
- t
- u
- n, –newest, Select most recently started.
- o, –oldest, Select least recently started.
- P, –parent <ppid>, Match only child processes of the given parent.</ppid>
- s, –session <sid>, Match session IDs</sid>
- t, –terminal <tty>, Match by controlling terminal.</tty>
- u, –euid <id>, Match by effective IDs</id>
pkill
- U
- x
- F
- L
–ns <pid></pid>
–nslist <ns></ns>
- U, –uid <id>, Match by real IDs.</id>
- x, –exact, Match exactly with the command name.
- F, –pidfile <file>, Read PIDs from file.</file>
- L, –logpidfile, Fail if PID file is not locked.
–ns <pid>, Match the processes that belong to the same namespace as <pid></pid></pid>
–nslist <ns>, List which namespaces will be considered for the --ns option. Available namespaces: ipc, mnt, net, pid, user, uts.</ns>
killall
killall sends a signal to all processes running any of the specified commands. If no signal name is specified, SIGTERM is sent.
killall
- e
- I
- g
- y
- o
- i
- l
- e, –exact
- I, –ignore-case
- g, –process-group
- y, –younger-than, Kill processes younger than TIME
- o, –older-than, kill processes older than TIME
- i, –interactive, Ask for confirmation before killing
- l, –list, List all known signal names
killall
- q
- r
- s
- u
- v
- w
- n
- Z
- q, –quiet
- r, –regexp
- s, –signal SIGNAL
- u, –user USER, Kill only processes running as user.
- v, –verbose
- w, –wait, Wait for processes to die.
- n, –ns PIS, match processes that belong to the same namespace as PID.
- Z, –context REGEXP, Kill only processes haveing context.