In Unix/Linux system administration, which command is used to display the characteristics and current status of running processes (for example, PID, TTY, time, and command)?
-
Aps
-
Bpid
-
Cdu
-
Dau
-
ENone of the above
Answer
Correct Answer: ps
Explanation
Introduction / Context:Monitoring processes is a core Unix/Linux skill. Administrators and developers routinely need to list active processes, see their process IDs (PIDs), controlling terminals, CPU time usage, and the commands that launched them. The standard utility that reveals these characteristics in a flexible way is essential for troubleshooting performance, runaway tasks, and job control.
Given Data / Assumptions:
- You are working on a Unix-like shell (bash/zsh).
- You want a snapshot of process attributes such as PID, TTY, CPU time, state, and command.
- No special kernel modules or third-party tools are assumed.
Concept / Approach:The 'ps' command (process status) reports properties of processes. Common flags include 'ps aux' (BSD style) to view all processes with users, or 'ps -ef' (SysV style) for a full listing. You can filter by PID, user, or terminal, and format columns with '-o' for custom output. This makes 'ps' the go-to tool for a quick, scriptable view of process characteristics.
Step-by-Step Solution:
Run basic listing on your terminal: psShow every process on the system: ps auxFull-format SysV listing: ps -efCustom columns (PID and command): ps -eo pid,cmdVerification / Alternative check:Correlate the reported PID with '/proc/
Why Other Options Are Wrong:
- pid: Not a standard command; PID is a process attribute, not a listing tool.
- du: Reports disk usage, not processes.
- au: Not a standard process display utility.
- None of the above: Incorrect because 'ps' is correct.
Common Pitfalls:Misinterpreting BSD vs SysV flags, forgetting to use root privileges for full listings, or assuming 'ps' is live-updating (it is a snapshot; use 'top' for continuous updates).
Final Answer:ps