Иногда бывает ситуация когда dev-сервер по какой-либо причине не закрылся и висит в процессах, занимая порт.
Это может быть из-за падения IDE или просто сам забыл погасить и закрыл терминал.
Для таких случаев я набросал простую функцию с командой:
kill_on_port() {
port=$(lsof -t -i:$1)
echo "KILL PROCESS:" $port
sudo kill -9 $port
}
alias killonport="kill_on_port $@"
Код поместить в ~/.bashrc и рестартнуть систему.
Если во время старта dev-сервера получаете ошибку что порт уже занят, просто выполните команду, подставив свой порт.
Bash
kill_on_port 8000
Скорее всего бесполезно, если другой процесс назначен на перезапуск вашего dev-сервера в случае падения.
Имя команды можете изменить на любое другое.
#linux
🏨Recommended hotels for the RAREMET-2026 participants
Dear participants of the RAREMET-2026 Congress!
The Congress website contains information about hotels that are ready to receive you on special terms during the event. In this section you will find addresses, promo codes for reservations and their validity periods.
📌 Details are available on our website.
🗓Dates of the Congress: RAREMET-2026 will be held on May 20-22 in Moscow at the RTU MIREA. The organizer is Giredmet JSC.
📱 Subscribe to our channels:
Telegram: t.me/raremet2026
MAX: max.ru/id7707072637_gos22
See you at the main forum of the rare metal industry!
#RAREMET2026#RAREMET2026#hotels#accommodation#participants