A Linux administrator is troubleshooting a web service failure where an application fails to start because network port 80 is already in use by another process. The administrator needs to run a command-line utility to identify the open network socket and display the specific Process ID (PID) bound to that port. Which of the following utilities should the administrator run?
- lsofCevap
- Bps
- Cdf
- Dchmod
Cevap
The lsof command-line utility should be used to list open files and network sockets associated with process IDs.
The lsof (list open files) command is used in Linux and macOS environments to report a list of all open files and the processes that opened them. Because network sockets are treated as files in Unix-like operating systems, running lsof -i :80 allows an administrator to quickly view which Process ID (PID) is currently bound to port 80.
Adım Adım Çözüm
Anahtar Kavram
macOS and Linux CLI System Monitoring and Inspection Utilities