On UNIX/Linux systems, which ps option shows a full-format listing, including the entire command line of each process?

Difficulty: Easy

Correct Answer: -f

Explanation:


Introduction / Context:
Process inspection is a routine admin task. The ps command displays process information, and the ability to see the full command and its arguments is crucial for troubleshooting services, scripts, and rogue processes.


Given Data / Assumptions:

  • Standard UNIX/Linux ps semantics (System V style) are assumed.
  • Goal: show the entire command line (args), owner, PID, and related columns.
  • Common short options are listed.


Concept / Approach:

The -f (full) option prints a fuller set of columns, typically including UID, PID, PPID, C, STIME, TTY, TIME, and CMD with arguments. Other listed options (-1, -2, -4) do not represent standard System V ps flags for showing the command line; on GNU, long options like -e and -f are common for “everything, full.”


Step-by-Step Solution:

Identify the need: view full command/arguments.Recall ps flags: -f provides full format.Choose -f; combine with -e or -A if all processes are needed.Example: ps -ef.


Verification / Alternative check:

Running ps -ef on Linux shows a CMD column containing the complete invoked command and arguments, verifying the option choice.


Why Other Options Are Wrong:

  • -1, -2, -4: not the standard flag for full listing; meanings vary or may be unsupported.
  • None of the above: incorrect because -f is correct and widely used.


Common Pitfalls:

  • Mistaking BSD-style flags (aux) for System V style (-ef); both work but use different syntax.
  • Truncated display in narrow terminals; use wide terminals or ps -eo custom formats.


Final Answer:

-f.

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion