Find All Programs Listening To Network Traffic On Linux

Find all programs listening to network traffic, and what port they are using, with the netstat command.

netstat -peanuto | grep LISTEN

We make use of the following flags on netstat

  • -p (--program) - Show the PID and name of the program to which each socket belongs.
  • -e (--extend) - Display additional information. Use this option twice for maximum detail.
  • -a (--all) - Show  both  listening  and non-listening sockets.  With the --interfaces option, show interfaces that are not up
  • -n (--numeric) - Show numerical addresses instead of trying to determine symbolic host, port or user names.
  • -o (--timers) - Include information related to networking timers.

See the command on explainshell.com.

Add new comment

The content of this field is kept private and will not be shown publicly.