Иногда бывает ситуация когда 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
Har bir kichik g‘oya — kelajakdagi katta ixtiro sari tashlangan birinchi qadam.
Bugungi musobaqa shuni yana bir bor isbotladi 💡
Robotlar, kreativ fikrlar va cheksiz imkoniyatlar — barchasi bizning o‘quvchilar qo‘lida! 🤖💙
#Robotatexnika#Motivatsiya#TechFuture#FoundationIT#KelajakMuhandislari
🚀We are pleased to welcome UNICON as an Exhibitor at ICT Week Uzbekistan 2025!
UNICON is Uzbekistan’s leading center for IT development, research, and innovation, driving forward the country’s digital transformation. With expertise in software engineering, e-government solutions, standards, and cutting-edge ICT projects, UNICON plays a key role in shaping the future of the national digital ecosystem. 🌐✨
By joining ICT Week Uzbekistan 2025, UNICON will showcase its latest technological solutions, research projects, and innovations designed to support businesses, government, and society in adopting next-generation digital services.
🤝 We look forward to hosting UNICON at the exhibition and creating new opportunities for collaboration, knowledge-sharing, and impactful partnerships.
📩 Interested in exhibiting or partnering? Let’s connect.
#ICTWeekUzbekistan#UNICON#Innovation#DigitalTransformation#ICTExhibitor#Uzbekistan#TechFuture