Netstat: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 38: Line 38:


==-a==
==-a==
Show the state of all sockets; normally sockets used by server processes are not shown. With the routing table display (option -r), show protocol-cloned routes (routes generated by a RTF_PRCLONING parent route); normally these routes are not shown.

Revision as of 17:55, 1 June 2017

External

Installation

yum install net-tools

Finding out what processes are listening and on what sockets

netstat -nl --program

The --program option will list the PID/process path.

Scan Open Ports and Shut Down Services

netstat -tulpn

Options

-n

Show numerical addresses instead of trying to determine symbolic host, port or user names.

-l

Show only listening sockets (these are omitted by default).

-p

Show the PID and name of the program to which each socket belongs.

-a

Show the state of all sockets; normally sockets used by server processes are not shown. With the routing table display (option -r), show protocol-cloned routes (routes generated by a RTF_PRCLONING parent route); normally these routes are not shown.