netstat stands for network statistics is a network analytics tools for Unix like system. It allows administrators to get a complete overview of the system network statistics including network connections, network interface stats, masquerade connections, open ports, and so on.
Most linux distributions have netstat pre-installed. This article will solely address the error that occurs when netstat is not installed. netstat was not pre-installed on the majority of the Docker containers I used.
bash: netstat: command not found
If you get the
bash: netstat: command not found error, it means the Linux distro you’re using does not have netstat installed.
netstat is the part of another tool called net-tools. net-tools is available in almost all Linux distributions repositories. So use your distro’s package manager to install net-tools.
Install net-tools on Ubuntu or derivatives
sudo apt install net-tools
Install net-tools on Arch Linux or derivatives
sudo pacman -S net-tools
Install net-tools on CentOS or derivatives
sudo yum install net-tools
Install net-tools on Fedora or derivatives
sudo dnf install net-tools