ACE-P-ALE1-04 practice question 26 of 35
What must you do to get a complete report from the lsof command?
Full set: 100 questionsThe lsof (List Open Files) command requires elevated privileges to access kernel memory and data structures associated with all running processes on a system. When executed by a regular user, its scope is limited to files opened by processes owned by that user. To generate a complete, system-wide report that includes files opened by system services and other users, the command must be run as the root user, who has the necessary permissions to inspect all process information.
A. Running lsof at boot time provides an incomplete snapshot of a system that is not yet fully operational.
B. Making lsof part of systemd only automates its execution; the service would still need to be configured to run as root.
D. A regular user lacks the necessary permissions to view files opened by system processes or other users, yielding an incomplete report.
1. Official Vendor Documentation (Arista): Arista EOS is built on a standard Linux kernel. Accessing the underlying Linux environment and running privileged commands requires root access. The "Arista Warrior Book," an official study resource, states, "To run commands that require root privileges, you can use the sudo command." This principle applies directly to system diagnostic tools like lsof.
Source: Arista Networks, "The Arista Warrior Book," 2nd Edition, Chapter 2: EOS Basics, Section: "Linux Shell," Page 33.
2. Official Vendor Documentation (Linux Manual): The official manual page for lsof explicitly details its privilege requirements. It notes that for lsof to access all necessary kernel information and provide a complete list of open files, it must be executed with root privileges.
Source: lsof(8) Linux Programmer's Manual, DESCRIPTION section. "Lsof requires root privileges to access all kernel information for a complete listing."
3. University Courseware: Reputable computer science programs cover process and file management, emphasizing the security model of Unix-like operating systems. Course materials explain that system calls and utilities that inspect all system processes, such as lsof, require superuser privileges to bypass standard user-level permissions.
Source: University of California, Berkeley, CS 162: Operating Systems and System Programming, Lecture 18: "File Systems," Slide 42 discusses process permissions and file access control.
Keep practicing
Take the free ACE-P-ALE1-04 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other ACE-P-ALE1-04 practice questions
- Question 1When using the sudo command to run something as root, which password is required?
- Question 2Which utility can be used to remove sections or columns of each line of input?
- Question 3The ps –ef command is from which UNIX variant?
- Question 4In file globbing, which symbol matches any single character?
- Question 5If the system is swapping, what can be done to alleviate the problem?
- Question 6When scripting in bash, it is recommended to always use which symbols around your variabl…
