Sereval Basic Linux Netstat Command
What is Netstat?
In computing, netstat
(network statistics) is a command-line network utility tool that displays network connections for the Transmission Control Protocol (both incoming and outgoing), routing tables, and a number of network interface (network interface controller or software-defined network interface) and network protocol statistics.
List out all connections
The most simple command is to list out all the current connections by using:
netstat -a
Example:
1 | $ netstat -a |
Get process name/pid and user id
When viewing the open/listening ports and connections, its often useful to know the process name/pid which has opened that port or connection.
You can use the following command:
sudo netstat -nlpt
Example:
1 | ~$ sudo netstat -nlpt |
Reference
This is the end of post