Menggunakan netstat

$ netstat -ltnp | grep -w ':80'

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).

lsof Command

$ lsof -i :80