Иногда бывает ситуация когда 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
🌍 Canada’s Manitoulin Island is the largest freshwater island in the world. It’s so big that it contains more than 100 lakes, and some of those lakes have islands of their own. ✨
#islands⚡#freshwater⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 In Canada’s Hudson Bay lowlands, vast freshwater wetlands cover over 300,000 square kilometers. This area stores so much water it helps regulate the region’s climate and slow permafrost thaw. ✨
#wetlands⚡#freshwater⚡#climate⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 Just 0.001% of all water on Earth is found in rivers, lakes, and the atmosphere. The vast majority is locked away in ice sheets, glaciers, or underground where we rarely see it. ✨
#hydrology⚡#watercycle⚡#freshwater⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 Some freshwater wetlands form floating islands—mats of living plants thick enough to walk on. These islands create unique microhabitats and drift slowly across lakes or shallow wetlands. ✨
#wetlands⚡#freshwater⚡#ecology⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The world's largest freshwater reserves are hidden underground as groundwater, not in lakes or rivers. These reserves are vital for drinking water and irrigation in many regions. ✨
#groundwater⚡#freshwater⚡#resources⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 Siberia's Lake Baikal holds more water than all the North American Great Lakes combined. It is the world’s deepest and oldest lake, home to unique species found nowhere else. ✨
#lake⚡#freshwater⚡#biodiversity⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Lake Baikal in Russia holds about 20% of the world’s unfrozen freshwater. It’s also the oldest and deepest lake on the planet, reaching depths of over 1,640 meters. ✨
#Baikal⚡#freshwater⚡#depth⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍