sudo apt-get install netstat code example
Example 1: netstat install
# apt install net-tools [On Debian/Ubuntu]
Example 2: install netstat linux centos 7
# yum install net-tools [On CentOS/RHEL]
# apt install net-tools [On Debian/Ubuntu]
# zypper install net-tools [On OpenSuse]
# pacman -S netstat-nat [On Arch Linux]