Fix “bash: netstat: command not found” error on Debian/Ubuntu Linux
Solution for the “bash: netstat: command not found” error on Debian/Ubuntu Linux is here. The netstat Linux command is used by system administrators.
What Is The Reason For the “bash: netstat: command not found” error?
You might know that the netstat command is no longer included by default in Ubuntu or in Debian and hence you will see the error if you try to run the command.
How To Fix “bash: netstat: command not found” error on Debian/Ubuntu Linux
A quick solution for this error is to install netstat command in Ubuntu or in Debian. Run the following command to install netstat tool on Ubuntu 22.04 LTS.
sudo apt update sudo apt install net-tools
This will solve the error in your system.
Meanwhile, let’s have a look into the usage of netstat command.
List All netstat Commands
netstat -hList All Ports and Connections using nestat command:
Run the following netstat command to list all ports and connections.
netstat -aList All TCP Ports
netstat -atList All UDP Ports
netstat -auList Only Listening Ports
netstat -lList TCP Listening Ports
netstat -ltList UDP Listening Ports
netstat -luDisplay PID
netstat -tpFind Listening Programs
netstat -lpFind a Process That Is Using a Particular Port using netstat command
netstat -an | grep ':[port number]'
