Иногда бывает ситуация когда 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
🌍 The Mongolian steppes have supported nomadic herding for centuries, with grasslands shaped by grazing animals and seasonal movement. This partnership keeps both wildlife and pastures thriving naturally. ✨
#nature⚡#society⚡#grasslands⚡#geography⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Temperate grasslands like the Eurasian steppes can experience temperature swings of over 40°C between summer and winter, creating some of the planet’s most extreme seasonal contrasts. ✨
#grasslands⚡#savanna⚡#climate⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 The Pampas grasslands in South America are so fertile they support one of the world’s largest cattle industries and can produce up to seven harvests of grass each year, fueling global food markets. ✨
#grasslands⚡#agriculture⚡#SouthAmerica⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Africa’s Miombo savanna covers over 2.7 million square kilometers—about the size of Argentina. Its woodlands support hundreds of unique butterfly species found nowhere else on Earth. ✨
#savanna⚡#grasslands⚡#ecosystems⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Some grassland plants grow deep roots reaching over 2 meters underground. These roots help the plants survive drought and anchor soil, making grasslands some of the most erosion-resistant landscapes. ✨
#grasslands⚡#savanna⚡#ecology⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Grasslands cover about 40% of Earth’s land surface and are found on every continent except Antarctica. Some of the world’s richest soils, called mollisols, form in temperate grasslands. ✨
#grasslands⚡#savanna⚡#soil⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 Some grassland soils are so fertile they can support crops for decades without added fertilizer. These deep, dark soils store huge amounts of carbon, helping stabilize the global climate. ✨
#grasslands⚡#soil⚡#carbon⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Argentina’s Pampas are vast temperate grasslands that grow some of the world’s richest soils. These grasslands support massive cattle herds and store huge amounts of carbon underground. ✨
#grasslands⚡#pampas⚡#carbon⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels