Related
Command
pingExplanation
The `ping` command is a basic network diagnostic tool used to check the reachability of a host on an IP network. It measures the round-trip time of packets sent from the source to a destination and back. Common options include `-c` to specify the number of pings, and `-i` to define the interval between packets.
Common Use Cases
- •Check if a remote host is reachable
- •Diagnose network latency issues
- •Test connectivity between servers or devices
Best Practices
- ✓Use `-c` to limit packet count in scripts
- ✓Ping IP address first if DNS resolution is in doubt
Common Mistakes to Avoid
- ⚠Running without specifying a target host
- ⚠Misinterpreting high latency as packet loss
Troubleshooting
Problem: No response from host
Solution: Ensure host is online and ICMP is not blocked by a firewall.
Problem: Name or service not known
Solution: Verify DNS resolution or use an IP address directly.
Examples
Test connection to Google
ping google.comSend 4 ICMP echo requests to Google's DNS
ping -c 4 8.8.8.8More
Secure Copy Files Between Hosts
Securely copy files or directories between local and remote hosts over SSH.
List Directory Contents
List files and directories in the current or specified directory with various formatting options.
Change Directory
Change the current working directory to a specified path.