GSEC · Question #189
You work as a Network Administrator for Tech Perfect Inc. The company has a Linux-based network. You want to kill a process running on a Linux server. Which of the following commands will you use to…
The correct answer is B. ps. The ps command displays currently running processes along with their PIDs, which is the necessary first step before terminating a process.
Question
You work as a Network Administrator for Tech Perfect Inc. The company has a Linux-based network. You want to kill a process running on a Linux server. Which of the following commands will you use to know the process identification number (PID) of the process?
Options
- Akillall
- Bps
- Cgetpid
- Dkill
How the community answered
(51 responses)- A18% (9)
- B71% (36)
- C8% (4)
- D4% (2)
Why each option
The ps command displays currently running processes along with their PIDs, which is the necessary first step before terminating a process.
killall terminates processes by name rather than by PID, so it does not display PID information.
The ps (process status) command lists active processes and their associated process identification numbers (PIDs). Without knowing the PID, an administrator cannot target a specific process with the kill command. Common usage includes 'ps aux' or 'ps -ef' to display all running processes and their PIDs.
getpid() is a C library system call used within programs to retrieve the calling process's own PID, not a standalone shell command.
kill sends a signal to terminate a process but requires the PID as an argument, meaning you must already know the PID before using it.
Concept tested: Linux ps command for PID discovery
Source: https://man7.org/linux/man-pages/man1/ps.1.html
Topics
Community Discussion
No community discussion yet for this question.