netstat on CentOS

Doing some Oracle DB Installation on CentOS, netstat is an essential tool for checking ports. On the minimal installation it is not installed. Check out how to install it.

This approach failed:

# yum install netstat

yum provides the command whatprovides, and it will give you the package name.

[root@localhost logs]# yum whatprovides netstat
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.bio.lmu.de
 * epel: epel.besthosting.ua
 * extras: artfiles.org
 * updates: centos.copahost.com
net-tools-2.0-0.17.20131004git.el7.x86_64 : Basic networking tools
Repo        : base
Matched from:
Filename    : /bin/netstat

Install it:

# yum install net-tools

After that you use it:

[root@localhost logs]# netstat -na | grep 1521
tcp6       0      0 :::1521                 :::*                    LISTEN     
tcp6       0      0 ::1:1521                ::1:50024               ESTABLISHED
tcp6       0      0 ::1:50024               ::1:1521                ESTABLISHED
unix  2      [ ACC ]     STREAM     LISTENING     65658    /var/tmp/.oracle/sEXTPROC1521