TestOut Linux Pro Practice Test

Question: 1 / 400

What command can you use to find out which processes are using a specific port?

lsof -i :[port_number]

The command that effectively identifies which processes are using a specific port is "lsof -i :[port_number]." This command utilizes the `lsof` (List Open Files) utility, which provides detailed information about files opened by processes, including network sockets. By specifying `-i :[port_number]`, it filters the output to only show processes that are listening on or connected to a specified internet port.

This command is particularly powerful as it not only shows the process IDs and names but also provides pertinent details like the user owning the process and the state of the connection. Such information is invaluable for troubleshooting network-related issues or understanding service usage on a server.

Other commands like `netstat -tuln` and `fuser -n tcp [port_number]` serve similar purposes but with different focuses. `netstat` shows active connections and listening ports but does not specify which processes are associated with those ports. `fuser` identifies processes using files or sockets but may require additional options to display the specific process details clearly. The option "findport" does not correspond to a standard command in Linux, making it an invalid choice.

Get further explanation with Examzify DeepDiveBeta

netstat -tuln

fuser -n tcp [port_number]

findport [port_number]

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy