A Linux administrator is troubleshooting an issue and needs to visualize the parent-child relationships of all running processes. The administrator wants to use a command that displays the processes as a tree and includes the Process ID (PID) next to each process name. Which of the following commands fulfills this requirement?
The correct command is pstree -p. The pstree command is specifically designed to show running processes as a tree, making it easy to see the hierarchy and parent-child relationships. The -p option adds the Process ID (PID) in parentheses after each process name. The pstree -a command is incorrect because the -a option shows the command-line arguments for each process, not their PIDs. The ps -ef --forest command can display a process tree, but pstree is the dedicated utility for this specific visualization task. The top --tree command is incorrect as top is an interactive process viewer and does not have a --tree command-line option for displaying a process hierarchy.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the main purpose of the pstree command in Linux?
Open an interactive chat with Bash
What does the -p option do in the pstree command?
Open an interactive chat with Bash
How does pstree differ from ps -ef --forest?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access