Иногда бывает ситуация когда 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
🌎 Perched atop a limestone cliff, the Italian town of Civita di Bagnoregio is slowly crumbling away as erosion eats at its base. Only about 12 people reside year-round, and the settlement is accessible by a pedestrian bridge spanning a deep valley. ✨
#geography⚡#architecture⚡#erosion
👉subscribe Interesting Planet
👉more Channels
🌍 Some coastlines in Alaska lose up to 20 meters of land each year from a mix of sea ice loss, stronger storms, and thawing ground, making it one of the fastest-eroding coastlines worldwide. ✨
#erosion⚡#coastline⚡#climate⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 Some sea stacks—towering rock columns near coastlines—form when waves erode cliffs, leaving only isolated pillars. Ireland’s Dun Briste sea stack stands 50 meters above the Atlantic. ✨
#coastline⚡#erosion⚡#geology⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 In some places, rising sea levels have pushed salty ocean water far inland, turning once-fresh coastal farmland into wetlands and forcing communities to change how and where they grow crops. ✨
#erosion⚡#sea-level ⚡#climate⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 In some places, coastal cliffs are vanishing so quickly that entire villages have moved inland within a single generation, as sea level rise and stronger storms speed up the erosion. ✨
#erosion⚡#coastlines⚡#climate⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 In some low-lying Pacific islands, entire villages have relocated inland as coastal erosion worsens from rising sea levels, erasing beaches and farmland within a single generation. ✨
#erosion⚡#sea-level ⚡#islands⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Rainwater can carve entire underground labyrinths in karst landscapes, creating vast networks of caves, tunnels, and sinkholes—some so deep and complex that new passages are still being found today. ✨
#caves⚡#karst⚡#erosion⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Coastal erosion is eating away cliffs and beaches so fast in some places that detailed maps need updating every year, with new shorelines appearing and disappearing before our eyes. ✨
#coastlines⚡#erosion⚡#mapping⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 In the last 30 years, parts of Louisiana’s coast have lost over 2,000 square kilometers of land to erosion and rising seas—an area bigger than many cities, disappearing into open water. ✨
#erosion⚡#sea-level ⚡#wetlands⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 In some regions, sea level rise combines with sinking land, making coastal erosion even faster. This double impact is shrinking important wetlands and salt marshes much quicker than before. ✨
#erosion⚡#wetlands⚡#sea-level ⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Coastal erosion now removes up to 24 square meters of land per meter of shoreline in some parts of West Africa each year, forcing whole fishing villages to move further inland. ✨
#coastlines⚡#erosion⚡#sea-level ⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Satellite data shows that some coastlines have retreated by over 50 meters in just a decade, as rising sea levels and stronger storms rapidly reshape shores across the globe. ✨
#erosion⚡#sea-level ⚡#coastlines⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels