Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kill all processes at port on AWS Linux

I am trying to kill processes on port 6006. However, I seem to be unable to use many of the recommended methods to do so. For example:

sh-4.2$ kill -9 $(sudo lsof -t -i:6006)

Does not work, throwing the error:

kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]

If it helps, this is the system I am using:

sh-4.2$  cat /etc/os-release
NAME="Amazon Linux AMI"
VERSION="2018.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2018.03"
PRETTY_NAME="Amazon Linux AMI 2018.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2018.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
like image 711
Joseph Konan Avatar asked Oct 28 '25 10:10

Joseph Konan


1 Answers

You can try this one line to kill the port

kill -9 $(lsof -t -i:3000 -sTCP:LISTEN)

Reference : https://stackoverflow.com/a/41791637/7697921

like image 53
Diluk Angelo Avatar answered Oct 30 '25 01:10

Diluk Angelo