What is the issue?

A user on the system has started a process, but it needs to be terminated.
The process ID was determined as follows:
pgrep userprogram
l5317
The user attempted to terminate the program as follows:
pkill 15317
This command runs without an error message, and the process continues to run.
What is the issue?

A user on the system has started a process, but it needs to be terminated.
The process ID was determined as follows:
pgrep userprogram
l5317
The user attempted to terminate the program as follows:
pkill 15317
This command runs without an error message, and the process continues to run.
What is the issue?

A.
You need to run the pkill command with the process name.

B.
You need to switch to super user to kill the process.

C.
You need to run the ps command to get more information.

D.
You need to run the prstat command to get more information.

Explanation:
You can use the pgrep and pkill commands to identify and stop command
processes that you no longer want to run. These commands are useful when you mistakenly start
a process that takes a long time to run.
To terminate a process:
Type pgrep to find out the PID(s) for the process(es).
Type pkill followed by the PID(s).
You can kill any process that you own. Superuser can kill any process in the system except for
those processes with process IDs of 0, 1, 2, 3, and 4. Killing these processes most likely will crash
the system.
Reference: Terminating Processes (pkill)



Leave a Reply 10

Your email address will not be published. Required fields are marked *


Richie

Richie

correct: Answer A
to terminate proccess with pkill use it with pattern (regex) – not PID

Marek

Marek

I agree with Richie, correct answer should be A.

vitalyb

vitalyb

of course

david

david

A is correct. you can also use # kill pid of course

mohammed

mohammed

pkill can be done by id or by name check man pkill