-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFind and kill PID.txt
45 lines (30 loc) · 1.66 KB
/
Find and kill PID.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
How to Find Process ID or Process Name
Command:
ps [options], ps -a
The most common options to add to ps are:
-a. View processes of all users rather than just the current user.
-u. Provide detailed information about each of the processes.
-x. Include processes that are controlled not by users but by daemons.
How to Kill a Process
Command:
killall [process], killall -i "process"
The killall command accepts several options:
-e. Find an exact match for the process name.
-I. Ignore the case when trying to find the process name.
-i. Ask for additional confirmation when killing the process.
-u. Only kill processes owned by a specific user.
-v. Report back on whether the process has been successfully killed.
Command:
pkill [options] [pattern]
pkill options include:
-n. Only kill the newest of the processes that are discovered.
-o. Only kill the oldest of the processes that are discovered.
-u. Only kill the processes owned by the specified user.
-x. Only kill the processes that match the pattern exactly.
-signal. Send a specific signal to the process, rather than SIGTERM.
Command:
kill [process ID]
The kill command kills a single process at a time with the given process ID. It sends a SIGTERM signal instructing a process to stop. It waits for the program to run its shutdown routine.
Command:
kill -9 [processID]
The kill -9 command sends a SIGKILL signal to a service, shutting it down immediately. An unresponsive program ignores a kill command, but it shuts down whenever a kill -9 command is issued. Use this command with caution since it bypasses the standard shutdown routine, and any unsaved data will be lost.