3
rated 0 times
[
3]
[
0]
/ answers: 1 / hits: 620
/ 1 Year ago, thu, december 8, 2022, 4:08:27
I always want to kill a process id which listening on Port 3000.
So presently I am using,
1.lsof -i tcp:3000
will give output as,
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ruby 6697 xxxx 5u IPv4 251982 0t0 TCP *:3000 (LISTEN)
and I will kill the PID using,
2. kill -9 6697
I want to create a bash program which do this process automatically.
I tried using xargs to get PID of the output of first command but failed.
More From » bash