Networking commands bridge the gap between your terminal and the outside world. Whether you’re testing an API endpoint, downloading a file, diagnosing connectivity issues, or checking what’s listening on your machine, these tools are indispensable for developers and system administrators.
HTTP requests with curl
curl is the Swiss Army knife of HTTP interaction. It sends requests, displays responses, and supports every HTTP method and header configuration you might need:
curl https://example.com # Simple GET request
curl -o file.html https://example.com # Save response to file
curl -I https://example.com # Headers only (HEAD request)
curl -X POST -d "key=value" https://url # POST with form data
curl -s https://ifconfig.me # Get your public IP (silent mode)
curl -v (verbose mode) is your best friend when debugging API integrations. It shows the full request and response including headers, TLS negotiation, and redirects.
Downloading files with wget
wget specializes in downloading files, with built-in support for resuming interrupted downloads:
wget https://example.com/file.tar.gz # Download file
wget -O output.txt https://url # Custom output filename
wget -c https://url/large-file # Resume interrupted download
For simple downloads,
wgetis often more convenient thancurlbecause it saves to a file by default and handles redirects automatically. For API interaction,curlis the better choice.
Connectivity testing with ping
ping is the first tool to reach for when network connectivity is in question. It sends ICMP echo requests and measures round-trip time:
ping google.com # Continuous ping (Ctrl+C to stop)
ping -c 4 google.com # Send exactly 4 pings then stop
Socket inspection with ss
ss (socket statistics) shows what’s listening on your machine and what connections are active. It replaced the older netstat command:
ss -tuln # Show listening TCP/UDP ports
ss -tp # Show TCP connections with process info
ss -tuln is the command to run when you get “address already in use” errors. It shows you exactly which process is occupying the port you need.
Network configuration with ip
On Linux, ip is the modern tool for viewing and configuring network interfaces:
ip addr show # Show all interfaces and IP addresses
ip route show # Show routing table
These networking commands are essential for debugging deployment issues, testing APIs, and understanding how your systems communicate.
Ready to practice? Explore the project repository for the full networking reference and interactive exercises.