Иногда бывает ситуация когда 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 deepest point on land is the Bentley Subglacial Trench in Antarctica, buried beneath almost 3 kilometers of ice. This hidden valley lies 2,555 meters below sea level, far deeper than Death Valley, and remains inaccessible except through advanced radar technology. ✨
#Antarctica⚡#geology⚡#extremes
👉subscribe Interesting Planet
🌍 The Gobi Desert experiences freezing winters with temperatures dropping below –40°C, making it one of the few deserts known for both scorching heat and extreme cold. ✨
#deserts⚡#climate⚡#extremes⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌎 High-altitude deserts like the Atacama in Chile are among Earth’s driest extreme climate zones, receiving less than 2 millimeters of rain a year. These parched regions are so arid that some weather stations have never recorded rainfall. ✨
#climate⚡#desert⚡#extremes
👉subscribe Interesting Planet
🌍 Antarctica’s interior is the only place on Earth with a true polar climate—temperatures rarely rise above freezing, and less precipitation falls each year than in most deserts. ✨
#climatezones⚡#antarctica⚡#extremes⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Earth holds the record for the highest known surface temperatures for a rocky planet in our Solar System, with some desert spots topping 56°C—hotter than the ground on Venus or Mars. ✨
#planet⚡#deserts⚡#extremes⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌎 Rising in the Peruvian Andes at 5,100 meters, La Rinconada is the world’s highest permanent settlement. Over 40,000 people live here, mostly mining gold in challenging conditions with no running water or sewage system. ✨
#settlements⚡#geography⚡#extremes
👉subscribe Interesting Planet
👉more Channels
🌎 Life thrives in Earth’s extreme climate zones, like the frigid polar regions and the hyper-arid Atacama Desert. The Atacama receives less than 2 mm of rain annually, making it one of the driest places on Earth, while Antarctica sees winter temperatures plunge below –60°C. ✨
#climate⚡#extremes⚡#geography⚡#adaptation
👉subscribe Interesting Planet
👉more Channels
🌍 The Lut Desert in Iran holds the record for Earth’s hottest land temperature ever measured from space—an astonishing 80.8°C, far exceeding typical desert heat. ✨
#deserts⚡#temperature⚡#extremes⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🪐 In 2016, astronomers using the Hubble Space Telescope observed the exoplanet WASP-121b, where temperatures in its stratosphere soar above 2,500°C and molecules such as water vapor exist as glowing, superheated gas. The planet’s intense gravity causes it to stretch into a teardrop shape, while metals like iron and magnesium escape its atmosphere, streaming into space in a shimmering trail. ✨
#exoplanets⚡#atmosphere⚡#extremes
👉subscribe Universe Mysteries
🌎 The coldest permanently inhabited place is Oymyakon, Russia, where winter temperatures drop below −50°C. The hottest surface temperature recorded was 80.8°C in Iran’s Lut Desert in 2005. ✨
#climate⚡#extremes⚡#Earth⚡#geography
👉subscribe Interesting Planet
🌎 Nestled in the Siberian taiga, the Russian town of Verkhoyansk is one of the coldest inhabited places on Earth. Winter temperatures can drop below –50°C, and the town recorded a range of over 105°C between its lowest and highest temperatures—a world record for temperature variation in a single settlement. ✨
#cities⚡#Siberia⚡#extremes
👉subscribe Interesting Planet
👉more Channels
🪐 Exoplanet 2MASS J2126–8140 holds the record for the widest known orbit around its star—about 1 trillion kilometers away, or nearly 7,000 times the distance from Earth to the Sun. This gas giant drifts so far from its host that a single "year" there lasts nearly 900,000 Earth years, exposing it to the coldest, loneliest planetary conditions ever measured. ✨
#exoplanets⚡#extremes⚡#space⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos
👉subscribe Universe Mysteries
👉more Channels