I wanted to check the ports that are open on a CentOS machine, but by default that server does not have netstat or other tool, so I found a workaround.