netstat command not found - Ubuntu

Page content

How to Install netstat Command on Ubuntu

If you’ve tried running the netstat command on your Ubuntu system and received a “command not found” error, don’t worry. In recent Ubuntu versions, the netstat command has been deprecated in favor of the ss command. ss stands for “socket statistics” and provides similar functionality to netstat.

Why is netstat command not found?

The reason you are seeing the “netstat command not found” error is because Ubuntu has transitioned to using ss as the primary tool for displaying socket statistics and network connections. This change was made to improve the efficiency and performance of network monitoring tools on Ubuntu systems.

How to Use ss command instead

To display network connections and socket statistics on Ubuntu, you can use the ss command in place of netstat. Here’s how you can use ss to achieve similar results:

ss -tulwn

This command will show all TCP (-t) and UDP (-u) listening (-l) connections along with the process that is using the connection (-n to show numerical addresses).

Conclusion

In conclusion, if you encounter the “netstat command not found” error on Ubuntu, it’s because the netstat command has been deprecated in favor of the ss command. By using the ss command, you can still monitor network connections and socket statistics effectively on your Ubuntu system.