[email protected]Support 24/7 · Billing 09:00 – 00:00LinkedInXFacebook
NexonHost
Netherlands Dedicated ServersAmsterdam · Equinix AM6Germany Dedicated ServersFrankfurt · Equinix FR4Romania Dedicated ServersBucharest · VoxilityAustria Dedicated ServersVienna · Interxion VIEBulgaria Dedicated ServersSofia · TelepointFrance Dedicated ServersParis · Interxion PAR — Marseille · Digital Realty MRS3Ireland Dedicated ServersDublin · Equinix DB2Italy Dedicated ServersMilan · Irideos AvalonPoland Dedicated ServersWarsawSpain Dedicated ServersMadrid · Equinix MD2United States Dedicated ServersAshburn · Equinix DC
All articles
Getting startedAugust 9, 2023

How to use netstat command.

What is netstat command?

netstat (network statistics) is a command-line utility used to display various network-related information on a computer. It provides information about active network connections, listening ports, routing tables, interface statistics, masquerade connections, and more. The exact functionality and output of netstat can vary slightly depending on the operating system you’re using.

-a -all : Show both listening and non-listening sockets. With the –interfaces option, show interfaces that are not up

# netstat -a | more 
: To show both listening and 
non-listening sockets.

List all tcp ports.

# netstat -at 
: To list all tcp ports.

List all udp ports.

# netstat -au 
: To list all udp ports.

List only listening ports.

# netstat -l 
: To list only the listening ports.

List only listening TCP ports.

# netstat -lt 
: To list only the listening tcp ports.

List only listening UDP ports.

# netstat -lu 
: To list only the listening udp ports.

List only the listening UNIX ports

# netstat -lx 
: To list only the listening UNIX ports.

List the statistics for all ports.

# netstat -s 
: To list the statistics for all ports.

List the statistics for TCP (or) UDP ports.

# netstat -st(TCP) 
: To list the statistics for TCP ports.
netstat -su(UDP) 
: List the statistics for UDP ports.

Display PID and program names in the output.

# netstat -pt 
: To display the PID and program names.

Print the netstat information continuously.

netstat will print information continuously every few seconds.

# netstat -c 
: To print the netstat information continuously.

The non-supportive address families in the system.

# netstat --verbose 
: To get the non-supportive
address families in the system.
At the end, we have something like this :

The kernel routing information.

# netstat -r 
: To get the kernel routing information.

The port on which a program is running.

# netstat -ap | grep ssh 
: To get the port
on which a program is running.

Which process is using a particular port:

# netstat -an | grep ':80' 
: To get the process
which is using the given port.

List of network interfaces.

# netstat -i 
: To get the list of network interfaces.
Display extended information on the interfaces 
(similar to ifconfig) using netstat -ie:

# netstat -ie
 : To display extended information 
on the interfaces

Keep reading
How To Set or Change Timezone on Debian 9.
May 30, 2023

How To Set or Change Timezone on Debian 9.

How To Set Or Change Timezone On Debian 9. Using the correct timezone is important for many systems related tasks and processes. For example, the cron daemon uses the system’s timezone for executing cron jobs and the timestamps in the log files are based on the same system’s timezone. The system’s…

Read article
How to Check if a File or Directory Exists in Bash.
May 30, 2023

How to Check if a File or Directory Exists in Bash.

How To Check If A File Or Directory Exists In Bash. Many times when writing Shell scripts, you may find yourself in a situation where you need to perform an action based on whether a file exists or not. In Bash, you can use the test command to check whether a file exists and determine…

Read article
How to install RPM on ubuntu.
May 29, 2023

How to install RPM on ubuntu.

How To Install RPM On Ubuntu. The Ubuntu repositories contain thousands of deb packages which can be installed from the Ubuntu Software Center or by using the apt command-line utility. Deb is the installation package format used by all Debian based distributions, including Ubuntu. Some packages…

Read article
Get in Touch

Together, Let’s Build a Faster, Safer Internet.

Build scalable infrastructure with NexonHost — high-performance dedicated servers, VPS hosting, cloud hosting, and DDoS protection across Europe.

Get Started →Contact Us
[email protected]Support 24/7 · Billing 09:00 – 00:00