Иногда бывает ситуация когда 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
🚀 Booked ₹1.37+ Lakh Profit! 💰
Another great day in the markets with smart entries & exits. 📈
Check out the power of precision trading! 🔥
🧠 Join my private trading community for real-time insights, setups, and mentorship. Whether you're new or experienced — you’ll level up fast.
👇 Click to join now
🔗https://t.me/+7emcw1k0H_U4ZDg9
📊 Stay ahead, trade smart. 💯
#BankNifty#OptionsTrading#StockMarketIndia#TradeLab#Profits
🚀 Booked ₹1.37+ Lakh Profit! 💰
Another great day in the markets with smart entries & exits. 📈
Check out the power of precision trading! 🔥
🧠 Join my private trading community for real-time insights, setups, and mentorship. Whether you're new or experienced — you’ll level up fast.
👇 Click to join now
🔗https://t.me/+7emcw1k0H_U4ZDg9
📊 Stay ahead, trade smart. 💯
#BankNifty#OptionsTrading#StockMarketIndia#TradeLab#Profits
🚀 Booked ₹1.37+ Lakh Profit! 💰
Another great day in the markets with smart entries & exits. 📈
Check out the power of precision trading! 🔥
🧠 Join my private trading community for real-time insights, setups, and mentorship. Whether you're new or experienced — you’ll level up fast.
👇 Click to join now
🔗https://t.me/bankniftygo
📊 Stay ahead, trade smart. 💯
#BankNifty#OptionsTrading#StockMarketIndia#TradeLab#Profits