Commands for sending signals by explicit request


A. Foreground Processes:

You can use the keyboard to issue a signal on your current processing by pressing a keyboard control sequence t

1. Suspend foreground process

# Ctrl+z

2. Kill foreground process

# Ctrl+c

3. Core Dump

# Ctrl+\

B. Background Process

  1. Check the list of kill option
# kill -l
 1) SIGHUP       2) SIGINT       3) SIGQUIT      4) SIGILL       5) SIGTRAP
 6) SIGABRT      7) SIGBUS       8) SIGFPE       9) SIGKILL     10) SIGUSR1
11) SIGSEGV     12) SIGUSR2     13) SIGPIPE     14) SIGALRM     15) SIGTERM
16) SIGSTKFLT   17) SIGCHLD     18) SIGCONT     19) SIGSTOP     20) SIGTSTP
..................................
# kill -9 PID

2. Look up processes based on name and kill them

# pgrep -l -u user1
7000 bash
7001 sleep
...............
# pkill -SIGKILL -u user1

Notes: SIGTERM is the default signal, SIGKILL is a commonly misused administrator favorite. Since the SIGKILL signal cannot be handled or ignored, it is always fatal. However, it forces termination without allowing the killed process to run self-cleanup routines. It is recommended to send SIGTERM first, then retry with SIGKILL only if a process fails to respond

3. kill processes running in tty3

# pkill -SIGKILL -t tty3

4. Use the pstree command to view a process tree for the system or a single user.

# pstree -p root

[root@lime ~]# pstree -p root
init(1)─┬─NetworkManager(1785)
├─abrtd(2232)
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s