Exclusive Metin2 game shield on FreeBSD: Automatic siege mode, VIP list, and whitelist from your dashboard. See how it works
Create a server

Guide

How to Install and Use lsof

lsof (list open files) shows which process holds a file or a port. Perfect when a service fails to start because the port is already taken.

Steps

  1. Install lsof:

    sudo apt update
    sudo apt install -y lsof
  2. Who is listening on port 80?

    sudo lsof -iTCP:80 -sTCP:LISTEN
  3. Which files does a given PID have open?

    sudo lsof -p PID
  4. Which process has a path open (e.g. a log or socket):

    sudo lsof /var/log/syslog

Tips

  • Without sudo you only see your own processes; on servers use root.
  • To free a port: note the PID from lsof, then kill PID carefully.

ext step

Debug ports on your own VPS: Deploy your Cloud VPS.

Related guides