New We are sorting MAX channels into categories and territories. Read the news

🔄 Как узнать, какой процесс держит порт в Linux?



Часто бывает, что нужный порт уже занят, и надо быстро найти, кто его "захватил". Используем lsof и ss.

📌 Вариант 1 — через lsof:

lsof -i :<порт>

🔹 Пример:

lsof -i :80

📌 Вариант 2 — через ss:

ss -tuln | grep :<порт>

🔹 Пример:

ss -tuln | grep :443

🧠 А чтобы сразу получить PID:

fuser <порт>/tcp

🔹 Пример:

fuser 22/tcp

🔥 Идеально подходит, чтобы выяснить, что мешает стартовать nginx, apache, sshd и т.д.

👉 @bash_srv
Views: 121
Open in MAX Report an inaccuracy

Report an inaccuracy

Describe what needs fixing. If you have a source, add a link.

You are leaving datool.ru

The link leads to an external website. datool.ru is not responsible for its content — check the address before entering passwords or payment details.

Redirecting in 10 s

Go