Ports are a concept of UDP and TCP. Ping messages are technically referred to as ICMP Echo Request and ICMP Echo Reply which are part of ICMP. ICMP, TCP, and UDP are “siblings”; they are not based on each other, but are three separate protocols that run on top of IP.
Therefore you can not
ping a port. What you can do, is use a port scanner like
nmap and check if ip/host and port are accessible.
$ nmap -p 80 www.google.com
Starting Nmap 6.40 ( http://nmap.org ) at 2015-12-02 14:38 IST
Nmap scan report for http://www.google.com (126.96.36.199)
Host is up (0.085s latency).
Other addresses for http://www.google.com (not scanned): 188.8.131.52 184.108.40.206 220.127.116.11 18.104.22.168 22.214.171.124
rDNS record for 126.96.36.199: sa-in-f106.1e100.net
PORT STATE SERVICE
80/tcp open http
Nmap done: 1 IP address (1 host up) scanned in 0.64 seconds
You can also use
telnet onofri.org 80