Иногда бывает ситуация когда 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
📰🇺🇸AMERICAN FAMILIES HIT BY WAR ECONOMY CRISIS
🔹 Gas prices surge to $6.50/gallon nationwide as Iran war disrupts oil supply 🏃♂️
🔹 Grocery inflation hits 18% in March, forcing families to food banks 🛒
🔹 Unemployment claims spike 40% as defense contractors lay off workers 📊
🔹 Credit card debt reaches record $2.3 trillion amid cost-of-living crisis 💳
🔹 Student loan payments resume while federal aid programs face cuts ⏰
🔹 Housing market collapse: mortgage rates hit 12%, sales down 60% 🏠
Middle class getting crushed while Pentagon gets $1.5T budget 😤💸
#economy#inflation#CostOfLiving
@america
What are some ways to reduce household expenses? Finance writer Dawn from ‘SG Budget Babe’ shares some of her top cost-saving tips.
➡️ Read more: go.gov.sg/costofliving-youknowornot-2
#YouKnowOrNot#CostofLiving#budgeting#adulting
Drop us a 👍🏻 or 🤩 if you like her tips!
Popular Uprising in Ethiopia : Solomon Gebreselassie , Neamin Zeleke.
Read more.
borkena.com/2025/11/10/pop… #News#popularuprising#humanrights#costofliving#security#peace
UN experts warned months ago that Israel is deliberately starving Palestinians, and that famine is rapidly spreading across Gaza, and yet Israel continues with impunity and is sent billions of dollars by the US. Children, infants, pregnant women, people living with disabilities, the elderly and those with chronic illnesses are the most at risk of severe malnutrition, illness, and death. Mobilize today, and continue boycotting products and companies that support these war crimes. #freegaza#freepalestine#endtheoccupation#humanitarianaid#costofliving#northgaza#gazacity#freedomflotilla#ffc#breakthesiege#endtheblockade
#BDS
* prices are in US dollars