Currently I do the to following clear all processes running on port
lsof -i :10000
and I get
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Google 10427 user 60u IPv4 0x162adea8 0t0 TCP localhost:52478->localhost:ndmp (ESTABLISHED)
Google 10427 user 112u IPv4 0x16289b98 0t0 TCP localhost:52483->localhost:ndmp (ESTABLISHED)
Then I kill it
kill 10427
I’m looking for a way to streamline the above process.
I’m guessing that the solution has to do with piping the output and killing it.
Something like (I think, here I assume that $1 is 10427).
lsof -i :10000 | kill $1
I’ve not done too much bash scripting so any help would be great.
I think you want something like
lsofsoultion would be more like