Soru

Zorluk: OrtamacOS and Linux Operating System Features and Tools

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?

  1. lsofCevap
  2. B
    ps
  3. C
    df
  4. D
    chmod

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

1
Identify the goal of the troubleshooting task.
The technician needs to locate which Process ID (PID) is actively bound to TCP port 80.
An existing process is occupying port 80, preventing the web service from starting.
2
Evaluate the functional capabilities of standard Unix/Linux command-line tools.
The lsof command (specifically lsof -i :80) lists open files and internet sockets, directly revealing the process name and PID holding port 80.
In Unix-like systems, network sockets are treated as open files.

Anahtar Kavram

macOS and Linux CLI System Monitoring and Inspection Utilities
Bu soruyu puanla