exam questions

Exam CIS-SM All Questions

View all questions & answers for the CIS-SM exam

Exam CIS-SM topic 1 question 15 discussion

Actual exam question from ServiceNow's CIS-SM
Question #: 15
Topic #: 1
[All CIS-SM Questions]

Which one of the following Linux commands can be used by a non root user to return the process ID listening on port 8080?

  • A. sudo netstat -an -p TCP | grep :8080
  • B. sudo netstat -anp | grep :8080
  • C. netstat -anp | grep :8080
  • D. netstat -an -pid * | grep :8080
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
KaushikiK
10 months, 1 week ago
B is the correct answer
upvoted 2 times
...
Abizai
11 months, 1 week ago
Selected Answer: B
I think B is correct. -a gets a list of available sockets on your system, -n displays numeric addresses and port numbers, -p gets the PID. And ofcourse sudo is required since the user is non root and pipe with grep at the end to limit the result to port 8080
upvoted 1 times
...
takagiko
1 year ago
Selected Answer: B
As far as I know, on AIX -p is an option to specify the protocol, but on Linux it is an option to display the process. And of course sudo is mandatory. So I think B is the correct answer.
upvoted 2 times
...
carstenschnorr
1 year ago
I opt for A a regular user has no privileges for netstat thus sudo is required theoretically TCP and UDP sockets could be bound to 8080 but the question is not clear on that. But from the sudo option, -an -p tcp is a valid syntax o Linux that woul show a PID column. , according to my understanding -anp will list the ports but not the PID
upvoted 1 times
...
Creel
1 year, 7 months ago
I think the correct answer is B
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago