100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Bash

Basic Networking Commands (ping, curl, ss)

Learn the essential command-line tools for diagnosing connectivity, testing HTTP endpoints, and inspecting open sockets and listening ports on Linux.

Networking, Disks & LogsBeginner9 min readJul 9, 2026
Analogies

Basic Networking Commands (ping, curl, ss)

Troubleshooting anything network-related on Linux — 'is the server up?', 'is this port actually listening?', 'why can't my app reach that API?' — comes down to a small toolkit of command-line utilities that every administrator and developer should be fluent in. ping tests basic reachability at the ICMP level, curl (and its sibling wget) exercise actual application-layer protocols like HTTP, ss (and its predecessor netstat) show what's listening and what's connected on the local machine, and tools like dig/nslookup, traceroute, and ip round out the picture for DNS and routing. Knowing which tool answers which question — and reading their output correctly — turns network troubleshooting from guesswork into a methodical process.

🏏

Cricket analogy: Diagnosing 'is the ground even accessible' is like a groundsman checking the pitch before a match: ping checks if the venue exists at all, curl checks if the actual match (HTTP service) is playable, and ss checks who's already occupying the nets locally.

ping: Basic Reachability

ping sends ICMP Echo Request packets to a target host and reports whether/how quickly ICMP Echo Reply packets come back, along with round-trip time statistics. It answers a narrow but foundational question: is there a live network path to this host at all, and how does the round-trip latency look? By default ping runs indefinitely until interrupted with Ctrl-C; use -c N to send exactly N packets and exit automatically, which is essential in scripts. A crucial caveat: many hosts and firewalls deliberately block ICMP for security/DoS-mitigation reasons, so a failed ping does NOT necessarily mean the host is down or unreachable at the application layer — it may simply mean ICMP is filtered while the actual service (e.g. HTTPS on port 443) works fine.

🏏

Cricket analogy: ping is like knocking on the boundary rope to see if there's an echo back from the stadium, using -c 5 to send exactly 5 knocks and stop; a failed ping doesn't mean no match is happening — the stadium might just have its PA system (ICMP) muted even though play (HTTPS) continues.

bash
# Send exactly 4 pings, then stop (good for scripting)
ping -c 4 example.com

# Sample output line:
# 64 bytes from 93.184.216.34: icmp_seq=1 ttl=56 time=11.2 ms

# Flood-free interval control (1 packet every 2 seconds)
ping -c 5 -i 2 10.0.0.5

# Use ping to check if a host is up, in a script
if ping -c 1 -W 2 10.0.0.5 &>/dev/null; then
    echo "Host is reachable"
else
    echo "Host is unreachable (or blocking ICMP)"
fi

curl: Testing Application-Layer Endpoints

curl transfers data to or from a URL using virtually any protocol (HTTP, HTTPS, FTP, and more), making it the standard tool for testing web APIs and services directly from the command line. Unlike ping, curl actually exercises the application protocol, so it tells you whether a web server is not just network-reachable but actually responding correctly at the HTTP layer — distinguishing, for example, a working service (200 OK) from a misconfigured one (502 Bad Gateway) or an authentication problem (401/403). Key flags to know: -I fetches only response headers (a HEAD request), -v shows the full request/response exchange including TLS handshake details, -o file saves the response body, -X sets the HTTP method, -H adds a header, and -d sends a request body (implicitly switching to POST).

🏏

Cricket analogy: curl is like an umpire actually reviewing the replay (application layer) rather than just checking the stadium lights are on; -I peeks at just the match officials' report (headers), -v shows the full review process including third-umpire signals (TLS handshake), and -X/-d let you submit a formal appeal (POST request).

bash
# Simple GET request, printing the response body
curl https://api.example.com/health

# Show only the HTTP status line and headers (no body)
curl -I https://api.example.com/health

# Verbose mode: see the full request/response and TLS handshake
curl -v https://api.example.com/health

# POST JSON data with a custom header
curl -X POST https://api.example.com/users \
     -H "Content-Type: application/json" \
     -d '{"name": "Ada"}'

# Fail with a non-zero exit code on HTTP errors (4xx/5xx), useful in scripts
curl -fsSL https://api.example.com/health -o /dev/null
echo "Exit code: $?"

# Follow redirects (-L) and show timing breakdown
curl -L -w "\ntotal time: %{time_total}s\n" -o /dev/null -s https://example.com

The -f (--fail) flag is essential for curl used inside scripts: without it, curl exits 0 (success) even when the server returns an HTTP error status like 404 or 500, because as far as curl's transport layer is concerned, it successfully received *a* response — the error is a curl script author's most common surprise. Combining -fsSL (fail on HTTP errors, silent progress meter, but still show errors, follow redirects) is a widely used idiom for reliable scripted health checks and downloads.

ss: Inspecting Sockets and Listening Ports

ss (socket statistics) is the modern replacement for the older netstat, reading directly from the kernel's netlink interface rather than parsing /proc, which makes it significantly faster on systems with many open connections. It answers questions like 'what process is listening on port 8080?' and 'what remote connections does this machine currently have open?'. -t filters to TCP, -u to UDP, -l shows only listening sockets, -n shows numeric addresses/ports instead of resolving hostnames (much faster and often clearer), and -p shows the owning process name and PID (typically requires root/sudo for other users' processes).

🏏

Cricket analogy: ss is like a modern ball-tracking system reading directly from the stump sensors (kernel netlink) instead of a scorer manually flipping through pages (/proc), answering 'which bowler is active on which end'; -t filters to the main format, -l shows only bowlers ready to bowl, and -p names the actual player.

bash
# All listening TCP sockets, with the owning process
sudo ss -tlnp

# Sample output line:
# LISTEN 0  128  0.0.0.0:22   0.0.0.0:*   users:(("sshd",pid=812,fd=3))

# All established TCP connections
ss -tn state established

# Only UDP listeners
ss -ulnp

# Summary statistics of all socket types
ss -s

# Check specifically whether something is listening on port 5432 (Postgres)
sudo ss -tlnp | grep 5432

netstat is deprecated on most modern distributions (part of the older net-tools package, which is often not installed by default anymore) in favor of the iproute2 suite (ss, ip). Scripts and runbooks still referencing netstat -tulnp should be updated to the ss equivalent (ss -tulnp), since net-tools may simply be absent on a fresh minimal server install, causing 'command not found' failures during an incident — precisely the worst time to discover a missing dependency.

Putting It Together: A Troubleshooting Sequence

A methodical approach to 'my app can't reach service X' typically layers these tools: first ping (or, if ICMP is blocked, skip straight to the next step) to check basic network reachability; then ss -tlnp on the target host (if you have access) to confirm the service is actually listening on the expected port and interface (0.0.0.0 vs 127.0.0.1 matters — a service bound only to localhost won't accept external connections); then curl -v from the client to exercise the actual protocol and see exactly where the failure occurs — DNS resolution, TCP connection, TLS handshake, or the HTTP response itself. This layered diagnosis, from network to transport to application, quickly isolates whether the problem is connectivity, configuration, or the application logic.

🏏

Cricket analogy: Diagnosing why a fan's app can't reach live scores layers checks like a broadcast engineer: ping the stadium (basic reachability), then ss -tlnp at the venue to confirm the camera feed is actually broadcasting on the right channel, then curl -v from the viewer's side to see exactly where the signal (DNS, connection, or feed itself) breaks.

  • ping tests ICMP-level reachability and round-trip latency; use -c N in scripts so it doesn't run forever, and remember ICMP is often blocked even when the service itself works.
  • curl exercises real application protocols (HTTP/HTTPS/etc.) and is the standard tool for testing APIs; -I fetches headers only, -v shows the full exchange.
  • curl's -f flag is required for scripts to actually fail on HTTP error status codes — without it, curl exits 0 even on a 404 or 500.
  • ss is the modern, faster replacement for netstat, reading from the kernel's netlink interface; -tlnp shows listening TCP sockets with owning processes.
  • A service listening on 127.0.0.1 only accepts local connections; check the bound address (0.0.0.0 vs 127.0.0.1) when 'it's listening but unreachable remotely'.
  • Layer diagnosis from network (ping) to transport/socket (ss) to application (curl -v) to isolate exactly where a connectivity problem originates.

Practice what you learned

Was this page helpful?

Topics covered

#Bash#LinuxShellScriptingStudyNotes#DevOps#BasicNetworkingCommandsPingCurlSs#Networking#Commands#Ping#Curl#StudyNotes#SkillVeris

Frequently Asked Questions

21 categories · pick one to explore

Where can I get free study notes for programming and tech subjects?
SkillVeris offers completely free study notes covering programming and tech subjects, with no signup fees or paywalls. The notes are structured by course and topic, written for quick understanding, and enriched with the Learn Through Hobbies analogy method, so you can revise concepts through cricket, music, gaming, cooking and more.
Are SkillVeris study notes good for exam revision?
Yes, the study notes are designed for efficient revision: each topic answers its heading immediately, keeps explanations concise, and links to related glossary terms and cheat sheets. Students preparing for university exams or certification tests use them as quick revision notes because they distil concepts without the padding of full textbooks.
What subjects do the free study notes cover?
The study notes span the platform's main domains, including AI and machine learning, Python and programming, web development, DevOps, cloud, security and databases. Coverage mirrors the 37 live courses, so notes exist for the topics you are actually studying, and new note sets are added as courses launch.
How are SkillVeris study notes different from regular textbooks?
The notes are answer-first, concise and free, whereas textbooks are long and often expensive. Each section explains one concept directly, then reinforces it through selectable hobby analogies like cricket or cooking. Notes also cross-link to the glossary, blog and cheat sheets, letting you jump to related material instantly instead of flipping pages.
Can I use the developer study material without creating an account?
The study notes are free to access, and SkillVeris does not charge anything for its developer study material at any point. Browsing notes is straightforward from the Study Notes section, and if you want progress tracking, certificates and AI Mentor conversations tied to your learning, a free account unlocks those extras.
Do the study notes explain concepts with analogies?
Yes, this is a signature SkillVeris feature. Study notes use the Learn Through Hobbies method, explaining technical concepts through analogies from twelve domains including cricket, music, gaming, photography, travel, movies, fitness, chess, cooking, finance, business and sports. You can switch the analogy domain instantly to whichever hobby makes the concept click.
Are the revision notes suitable for last-minute exam preparation?
Yes, revision notes on SkillVeris work well for last-minute preparation because every section states the answer in its first sentences, so skimming is genuinely effective. Pair them with the relevant cheat sheet for formulas and syntax, and use the glossary for any unfamiliar term you meet while cramming.
Is there free study material for AI and machine learning?
Yes, SkillVeris provides free study notes across its AI and ML catalogue, covering Python for AI, deep learning frameworks like PyTorch and TensorFlow, Hugging Face Transformers, Large Language Models, RAG, AI agents and MLOps. All of it is free, making it a strong resource for Indian students and global learners alike.
Can beginners understand the study notes, or are they for experts?
Beginners can absolutely use them. The notes are written in plain language, define terms as they appear, and lean on hobby analogies to make abstract ideas concrete. Difficulty scales with the underlying course level, so beginner-course notes stay gentle while advanced-course notes go deeper, and the glossary supports you throughout.
How do study notes connect with SkillVeris courses?
Study notes are organised by course and topic, so they map directly to the structured courses and their 24–40-lesson curriculum. Many learners study a lesson first, then use the matching notes for revision before module assessments and the final exam, where 80 percent is required to pass and earn the certificate.
Are there study notes for Python specifically?
Yes, Python is well covered through notes tied to the Python-focused courses, including Python for AI and ML. Topics span fundamentals through applied machine learning usage. You can reinforce the notes with Python practice in Code Lab, which runs code in your browser with no installation required.
Do the study notes include code examples?
Yes, study notes include code examples wherever a concept is best shown in code, alongside explanations, key points and analogies. Reading a snippet in the notes and then reproducing it yourself in Code Lab is an effective loop, since Code Lab lets you run code in the browser across six languages.
How often is new study material added to SkillVeris?
Study material grows alongside the course catalogue. Whenever new courses join the platform's 37 live courses, matching study notes, glossary entries and cheat sheets are added so the resources stay in sync. Existing notes are also refined over time, so it is worth revisiting topics you studied earlier.
Can I use SkillVeris notes to prepare for technical interviews?
Yes, the notes make excellent interview revision because they compress each concept into direct, answer-first explanations, which mirrors how you should answer interview questions. Combine them with the SkillVeris interview questions feature, which includes readiness scoring, to test whether your revision has actually made you interview-ready.
Are the study notes mobile-friendly for studying on the go?
Yes, the study notes are built to load fast and read comfortably on mobile devices, so you can revise during a commute or between classes. Sections are short and answer-first, which suits small screens, and analogy switching works on mobile too, letting you study anywhere without carrying books.
What is the difference between study notes and cheat sheets?
Study notes explain concepts in depth with context, examples and analogies, making them ideal for learning and revision. Cheat sheets are compact quick-reference summaries of syntax, commands and key facts, ideal once you already understand a topic. Most learners study the notes first, then keep the cheat sheet handy while coding.
Do study notes help if I am stuck on a course lesson?
Yes, reading the matching study notes often clarifies a lesson because the same concept is explained from a different angle, frequently with a different analogy. If you are still stuck, ask the AI Mentor, which answers 24/7 at Quick, Detailed or Deep-dive depth until the idea genuinely makes sense.
Is there free study material for DevOps and cloud topics?
Yes, SkillVeris carries free study notes for DevOps and cloud topics as part of its coverage across 37 live courses. The material suits learners following the DevOps Engineer or Cloud Engineer paths, and it links to related glossary terms and cheat sheets so you can revise the whole toolchain in one place.
Can school or college students in India use these notes for projects?
Yes, students across India and worldwide use SkillVeris notes for coursework, projects and exam preparation, and everything is free, which matters for student budgets. The notes explain concepts clearly enough to cite in project reports, and Code Lab lets you prototype the project code directly in your browser.
How should I combine study notes with other SkillVeris resources?
A proven loop: learn from a course lesson, revise with the matching study notes, look up unfamiliar terms in the glossary, keep the cheat sheet open while practising in Code Lab, and quiz yourself with interview questions. The AI Mentor fills any remaining gaps 24/7, at whatever depth you need.

What Learners Say

Real journeys from the SkillVeris community — swipe for more.

SkillVeris taught me Python through Cricket. Now I’m building real projects and feeling confident!
Arjun S. · B.Tech Student
The best platform for hobby-based learning. Concepts finally stick.
Priya R. · Data Analyst
I went from zero coding to a portfolio of projects — all by learning through my love for gaming. Landed my first internship!
Kabir M. · CS Undergraduate
Trending Topics50 popular tags — tap to explore
Trending CoursesAll 37 free courses — tap to browse