Иногда бывает ситуация когда 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
🌎 High atop the Pacific Northwest, Mount St. Helens’ 1980 eruption was so powerful it removed over 400 meters from the volcano’s summit, reshaping the landscape dramatically in just minutes. Ash spread across 11 states, making it one of the most significant volcanic events in U.S. history. ✨
#volcano⚡#eruption⚡#geology
👉subscribe Interesting Planet
🌍 Mount St. Helens in the United States grew a new lava dome inside its crater after erupting in 1980. This ongoing dome-building is a rare case of a volcano rebuilding itself after collapse. ✨
#volcano⚡#mountains⚡#eruption⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The Tonga eruption in 2022 sent shockwaves around the globe so powerful they circled Earth several times. Its volcanic plume was the tallest ever recorded, reaching almost 58 kilometers high. ✨
#volcano⚡#eruption⚡#disasters⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Earth’s largest volcanic eruption in the past 70,000 years was Toba in Indonesia. Its explosion formed a lake-filled crater 100 kilometers wide and sent ash around the globe. ✨
#disasters⚡#volcano⚡#eruption⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 In 2015, Chile’s Calbuco volcano erupted after 43 years of silence, blasting ash over 15 kilometers high. Its sudden activity disrupted air travel and blanketed towns in thick volcanic dust. ✨
#volcano⚡#disaster⚡#eruption⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
#Philippines#volcano#eruption#ecology#weather#climate#destruction#anomaly#climatechange
🇵🇭Мощное извержение вулкана Майон (2 мая 2026 года)
🌋 Мощное извержение вулкана Майон произошло в провинции Альбай на острове Лусон, Филиппины. Вулканическая активность сопровождалась выбросами пепла и потоками лавы, представляя угрозу для близлежащих сообществ.
🌫 Пепловые облака могут ухудшить качество воздуха и повлиять на транспорт, включая авиацию.
Подобные природные явления являются частью геологической активности региона, но их воздействие на людей и окружающую среду может быть значительным.