CIS-SM practice question 15 of 25
Which one of the following Linux commands can be used by a non root user to return the process ID listening on port 8080?
Full set: 106 questionsThe command netstat -anp | grep :8080 is the correct choice. The netstat command displays network connections. The flag -a shows all sockets, -n displays numerical addresses, and -p shows the Process ID (PID) and name of the program for each socket. A non-root user can execute this command; however, the -p flag will only reveal PID information for processes owned by that user. The grep :8080 command filters the output to isolate the specific port. Options using sudo are incorrect as they execute the command with elevated (root) privileges, which contradicts the "non-root user" constraint specified in the question.
A. The sudo command executes the command with root privileges, which is explicitly contrary to the "non-root user" requirement in the question.
B. This option also uses sudo, which requires root privileges and therefore cannot be the correct command for a non-root user acting without privilege escalation.
D. The syntax -pid is not a valid option or argument for the netstat command in standard Linux distributions.
1. ServiceNow Product Documentation: The use of netstat -anp for troubleshooting is documented in the context of the Management, Instrumentation, and Discovery (MID) Server, a core ServiceNow component. For example, the command is recommended to check for port conflicts or verify listener status.
Source: ServiceNow Support Knowledge Base, Article ID: KB0752378, "MID Server connection test fails," Section: "Solution."
Source: ServiceNow Support Knowledge Base, Article ID: KB0535145, "Troubleshoot MID Server not connecting," Section: "Check for port conflicts."
2. University Courseware: University-level computer science and operating systems courses often cover standard Linux networking utilities. The functionality of the -p flag to show the PID is standard course material.
Source: Johns Hopkins University, Department of Computer Science, Course 601.229 Computer System Fundamentals, "Lecture 18: Sockets," Slide 29. The slide lists common netstat options, specifying -p to "show program name/pid."
Keep practicing
Take the free CIS-SM practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other CIS-SM practice questions
- Question 2Which of the following are methods used to initiate discovery on a service? (Choose three…
- Question 3In Event Management, which of the following rules allows for automatic task creation?
- Question 4Which one of the following best describes the process that Service Mapping uses to run a …
- Question 5In Service Mapping, when discovery is started, what is the execution strategy used to run…
- Question 6In ServiceNow Discovery, which one of the following phases is the server RAM value discov…
- Question 7Predictive Intelligence provides which one of the following benefits?
