nerdexam
GIAC

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.

Linux and Cryptography

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)
  • A
    18% (9)
  • B
    71% (36)
  • C
    8% (4)
  • D
    4% (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.

Akillall

killall terminates processes by name rather than by PID, so it does not display PID information.

BpsCorrect

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.

Cgetpid

getpid() is a C library system call used within programs to retrieve the calling process's own PID, not a standalone shell command.

Dkill

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

#Linux commands#process management#ps command#PID

Community Discussion

No community discussion yet for this question.

Full GSEC Practice