Difficulty: Easy
Correct Answer: ps
Explanation:
Introduction / Context:
Being able to view process characteristics is essential for Unix/Linux troubleshooting and performance tuning. Administrators and developers rely on a standard tool to see a snapshot of running processes, including process IDs, controlling terminals, resource usage, parent relationships, and the command that launched each process.
Given Data / Assumptions:
Concept / Approach:
The command 'ps' (process status) prints process attributes in various formats. Common invocations include 'ps aux' (BSD style) to list all processes system-wide and 'ps -ef' (SysV style) for a full-format listing. Options like '-o' allow custom column selection, while filters such as '-u user' or a specific PID restrict the output to what you need.
Step-by-Step Solution:
Verification / Alternative check:
Cross-check PIDs reported by 'ps' with corresponding entries under '/proc/
Why Other Options Are Wrong:
Common Pitfalls:
Mixing BSD and SysV option styles (some flags differ), assuming 'ps' auto-updates (it does not; it is a snapshot), or forgetting to elevate privileges when listing processes owned by other users and expecting complete results.
Final Answer:
ps
Discussion & Comments