Skip to content

Instantly share code, notes, and snippets.

@Prussia
Created April 30, 2018 02:53
Show Gist options
  • Select an option

  • Save Prussia/fe82674b94fa8f84685169a280c36bf0 to your computer and use it in GitHub Desktop.

Select an option

Save Prussia/fe82674b94fa8f84685169a280c36bf0 to your computer and use it in GitHub Desktop.
$ sudo netstat -ltnp | grep ':80'
tcp6 0 0 X.X.X.X:80 :::* LISTEN 121638/java
# In the above command, the flags.
# l – tells netstat to only show listening sockets.
# t – tells it to display tcp connections.
# n – instructs it show numerical addresses.
# p – enables showing of the process ID and the process name.
# grep -w – shows matching of exact string (:80).
# kill [signal or option] PID(s)
# Signal Name Signal Value Behaviour
# SIGHUP 1 Hangup
# SIGKILL 9 Kill Signal
# SIGTERM 15 Terminate
$ sudo kill -9 121638
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment