nerdexam
GIAC

GSEC · Question #316

If a Linux administrator wanted to quickly filter out extraneous data and find a running process named RootKit, which command could he use?

The correct answer is B. ps-ef/ grep Rootkit. The ps -ef command lists all running processes in full format, and piping its output to grep filters for the specific process name, making it the correct tool to quickly locate a named process.

Linux and Cryptography

Question

If a Linux administrator wanted to quickly filter out extraneous data and find a running process named RootKit, which command could he use?

Options

  • Acat/proc;grep Rootkit
  • Bps-ef/ grep Rootkit
  • Csed's/Rootkit/g'/var/log/messages
  • Dtail/var/log/messages> Rootkit
  • Etop-u Rootkit

How the community answered

(32 responses)
  • A
    3% (1)
  • B
    75% (24)
  • C
    13% (4)
  • D
    3% (1)
  • E
    6% (2)

Why each option

The ps -ef command lists all running processes in full format, and piping its output to grep filters for the specific process name, making it the correct tool to quickly locate a named process.

Acat/proc;grep Rootkit

cat on the /proc directory is invalid because /proc is a virtual filesystem with subdirectories, not a file that cat can read, and using a semicolon instead of a pipe means grep would search its own stdin rather than the cat output.

Bps-ef/ grep RootkitCorrect

The command ps -ef outputs every running process with full details including PID, PPID, and command name, covering all users and sessions. Piping that output to grep RootKit uses standard Unix text filtering to isolate only the lines matching the target process name. This combination is the canonical and fastest method to check whether a specific named process is running on a Linux system.

Csed's/Rootkit/g'/var/log/messages

The sed command shown attempts a text substitution in /var/log/messages, which searches a log file for text rather than inspecting live running processes.

Dtail/var/log/messages> Rootkit

tail /var/log/messages redirects the end of a log file into a file named RootKit rather than searching for a running process.

Etop-u Rootkit

The top -u flag filters processes by username, not by process name, so top -u RootKit would look for a user account named RootKit, not a process with that name.

Concept tested: Linux process inspection using ps and grep

Source: https://man7.org/linux/man-pages/man1/ps.1.html

Topics

#Linux commands#ps command#process management#grep

Community Discussion

No community discussion yet for this question.

Full GSEC Practice