Kill the process of a specific port

  1. image.png

  2. #Kill the process of a specific port number

  3. #method one:

  4. kill -9 `lsof -i:18100 | awk'NR ==2{print $2}' `# start from the second line

  5. #Method Two:

  6. kill -9 `lsof -i | grep 18100 | awk '{print $2}'`

  7. #Method Three:

  8. kill -9 `ss -antlup | grep 18100 | awk '{print $7}' | awk -F'[=,]' '{print $3}'`



Guess you like

Origin blog.51cto.com/zhzhgo/2588849