Unix Networking Commands (curl, wget, netstat, ss, nmap, dig, ping, traceroute)

Network diagnostics and data transfer: curl/wget (HTTP), netstat/ss (socket stats), nmap (port scanning), dig (DNS), ping/traceroute (connectivity).

  • JSON18,684 B
  • YAML11,160 B · −40%
  • TOON10,648 B · −43%

Unix networking commands with purpose, common usage, important options and notes: curl, wget, ss, netstat, nmap, dig, ping and traceroute.

Use it when

  • You are diagnosing connectivity, DNS or open ports from the command line.
  • You need the right tool and flags for a network task.

Watch out for

  • Scanning networks you do not own or have permission to test may be illegal; use nmap only on authorized systems.
  • netstat is largely replaced by ss on modern Linux.

The data

Commands

NamePurposeCommon usageImportant optionsExample output typeRelated commandsNotes
curlTransfer data from or to a server using various protocols (HTTP, HTTPS, FTP, SCP, SFTP, etc.)curl [options] <URL>
X <method>H <header>D <data>Data binary <file>O <file>OLVSKU <user:pass>I
Specify HTTP method (GET, POST, PUT, DELETE)nullnullnullnullnullnullnullnullnullnullnull
nullAdd custom headernullnullnullnullnullnullnullnullnullnull
nullnullHTTP POST data (application/x-www-form-urlencoded)nullnullnullnullnullnullnullnullnull
nullnullnullPOST binary data from filenullnullnullnullnullnullnullnull
nullnullnullnullWrite output to filenullnullnullnullnullnullnull
nullnullnullnullnullSave output with remote filenamenullnullnullnullnullnull
nullnullnullnullnullnullFollow redirectsnullnullnullnullnull
nullnullnullnullnullnullnullVerbose (show request/response headers)nullnullnullnull
nullnullnullnullnullnullnullnullSilent mode (no progress)nullnullnull
nullnullnullnullnullnullnullnullnullAllow insecure SSL connectionsnullnull
nullnullnullnullnullnullnullnullnullnullBasic authenticationnull
nullnullnullnullnullnullnullnullnullnullnullFetch headers only (HEAD request)
HTTP response body, headers, or status code (with -w)
  • wget
  • httpie
  • aria2
curl doesn't follow redirects by default (-L). Use -w '%{http_code}' to capture status. Supports multi-part uploads (-F). Can send multiple requests with --next. Extremely scriptable for API testing.
wgetNon-interactive network downloader. Retrieves files via HTTP, HTTPS, FTP.wget [options] <URL>
O <file>P <dir>RNpNCQNvLimit rate <speed>No check certificate
Output to specific filename (or - for stdout)nullnullnullnullnullnullnullnullnull
nullSave to directorynullnullnullnullnullnullnullnull
nullnullRecursive download (crawl)nullnullnullnullnullnullnull
nullnullnullNo parent (stay within directory hierarchy)nullnullnullnullnullnull
nullnullnullnullTimestamp-check only download newer filesnullnullnullnullnull
nullnullnullnullnullContinue partial downloadsnullnullnullnull
nullnullnullnullnullnullQuiet outputnullnullnull
nullnullnullnullnullnullnullNon-verbose but show errorsnullnull
nullnullnullnullnullnullnullnullThrottle download speednull
nullnullnullnullnullnullnullnullnullIgnore SSL cert errors
File saved to disk, progress bar on stderr
  • curl
  • aria2c
  • axel
wget is recursive by design (good for mirroring). -c resumable downloads work only if server supports Range header. Good for cron jobs (non-interactive). Can download multiple URLs from file via -i. Lacks curl's protocol variety.
ss (Socket Statistics)Investigate network sockets and connections. Modern replacement for netstat (faster, more detailed).ss [options] [filter]
TULANPISEM4/ 6
TCP socketsnullnullnullnullnullnullnullnullnullnull
nullUDP socketsnullnullnullnullnullnullnullnullnull
nullnullListening sockets onlynullnullnullnullnullnullnullnull
nullnullnullAll sockets (listening + established)nullnullnullnullnullnullnull
nullnullnullnullNumeric output (don't resolve names)nullnullnullnullnullnull
nullnullnullnullnullShow process using socketnullnullnullnullnull
nullnullnullnullnullnullShow internal informationnullnullnullnull
nullnullnullnullnullnullnullSummary statisticsnullnullnull
nullnullnullnullnullnullnullnullExtended socket info (timers, marks)nullnull
nullnullnullnullnullnullnullnullnullShow memory usagenull
nullnullnullnullnullnullnullnullnullnullIPv4/IPv6 only
Table: Netid, State, Recv-Q, Send-Q, Local Address:Port, Peer Address:Port, Process
  • netstat
  • lsof -i
  • ip
  • nmap
ss reads directly from kernel via netlink (faster than netstat's /proc parsing). Filters: state = (established, listen, etc.), dport = :80, src 192.168.1.1. -p requires root for other users' processes. Essential for diagnosing connections and listening ports.
netstatDisplay network connections, routing tables, interface stats, masquerade connections, and multicast memberships.netstat [options]
ATULPNRISCE
All sockets (listening + non-listening)nullnullnullnullnullnullnullnullnullnull
nullTCP connectionsnullnullnullnullnullnullnullnullnull
nullnullUDP connectionsnullnullnullnullnullnullnullnull
nullnullnullListening sockets onlynullnullnullnullnullnullnull
nullnullnullnullShow PID/Program name (requires sudo)nullnullnullnullnullnull
nullnullnullnullnullNumeric output (no DNS resolution)nullnullnullnullnull
nullnullnullnullnullnullRouting tablenullnullnullnull
nullnullnullnullnullnullnullInterface statisticsnullnullnull
nullnullnullnullnullnullnullnullProtocol statisticsnullnull
nullnullnullnullnullnullnullnullnullContinuous update (like top)null
nullnullnullnullnullnullnullnullnullnullExtended info (TCP states, etc.)
Table: Proto, Recv-Q, Send-Q, Local Address, Foreign Address, State, PID/Program name
  • ss
  • lsof
  • ip
  • ifconfig
netstat is deprecated in favor of ss and ip. Still ubiquitous. -anp shows all connections with processes. Routing table: netstat -rn. Interface stats: netstat -i. Use -s to see packet loss/errors per protocol. Can be slow on systems with many connections.
nmapNetwork exploration and security auditing. Port scanning, service detection, OS fingerprinting.nmap [options] <target>
S sS tS uS vOAP <ports>PnT<0 5>O n/ o x/ o gScript <category>
TCP SYN scan (stealth, requires root)nullnullnullnullnullnullnullnullnullnull
nullTCP connect scan (no root)nullnullnullnullnullnullnullnullnull
nullnullUDP scan (slow)nullnullnullnullnullnullnullnull
nullnullnullVersion detection (service/version info)nullnullnullnullnullnullnull
nullnullnullnullOS detectionnullnullnullnullnullnull
nullnullnullnullnullAggressive: OS + version + script + traceroutenullnullnullnullnull
nullnullnullnullnullnullPort range (e.g., -p 1-1000, -p 80,443)nullnullnullnull
nullnullnullnullnullnullnullTreat all hosts as online (skip ping)nullnullnull
nullnullnullnullnullnullnullnullTiming template (0=paranoid, 5=insane)nullnull
nullnullnullnullnullnullnullnullnullOutput to normal/ XML/ grepablenull
nullnullnullnullnullnullnullnullnullnullRun NSE scripts (vuln, discovery)
Port table: PORT, STATE (open/closed/filtered), SERVICE, VERSION
  • masscan
  • hping3
  • netcat
  • dig
Scanning requires authorization. SYN scan (-sS) is stealthy but needs root. States: open (listening), closed (not listening), filtered (firewall). -p- scans all 65535 ports (slow). Version detection (-sV) helps identify services. NSE scripts automate vulnerability checks.
dig (Domain Information Groper)DNS lookup utility. Query DNS servers for resource records. Powerful debugging tool for DNS issues.dig [@server] <name> [<type>]
T <type>@<server>+short+trace+dnssec+multilineX <ip>P <port>+noall +answer
Query record type (A, AAAA, MX, NS, TXT, CNAME, SOA, ANY)nullnullnullnullnullnullnullnull
nullQuery specific DNS server (default: /etc/resolv.conf)nullnullnullnullnullnullnull
nullnullBrief output (just answer)nullnullnullnullnullnull
nullnullnullTrace resolution from root serversnullnullnullnullnull
nullnullnullnullRequest DNSSEC records (DNSKEY, RRSIG)nullnullnullnull
nullnullnullnullnullWrap long records nicelynullnullnull
nullnullnullnullnullnullReverse lookup (PTR)nullnull
nullnullnullnullnullnullnullQuery non-standard portnull
nullnullnullnullnullnullnullnullShow only answer section
DNS response sections: ANSWER (records), AUTHORITY (NS records), ADDITIONAL (glue), STATUS (NOERROR/NXDOMAIN)
  • nslookup
  • host
  • whois
dig output shows header, question, answer, authority, additional sections. +short for quick checks. Use dig +trace to see full delegation chain. Reverse: dig -x 8.8.8.8. Compare answers from multiple servers by changing @1.1.1.1, @8.8.8.8.
pingTest network reachability and round-trip time (RTT) using ICMP echo requests.ping [options] <host/IP>
C <count>I <interval>W <timeout>W <deadline>S <size>QFI <interface>
Send only N packets (stop after N)nullnullnullnullnullnullnull
nullWait N seconds between pings (default 1s)nullnullnullnullnullnull
nullnullTime to wait for response (seconds)nullnullnullnullnull
nullnullnullTotal time to run (seconds)nullnullnullnull
nullnullnullnullPacket size (payload, default 56)nullnullnull
nullnullnullnullnullQuiet output (summary only)nullnull
nullnullnullnullnullnullFlood ping (requires root, rapid fire)null
nullnullnullnullnullnullnullSource interface/address
Lines: 64 bytes from host: icmp_seq=N ttl=64 time=XX.X ms, plus summary statistics
  • traceroute
  • mtr
  • ping6
  • fping
Measures latency and packet loss. ICMP may be blocked by firewalls. Standard ping packet: 56 bytes data + 8 bytes ICMP header = 64 bytes total. Use ping -c 4 google.com for quick check. -f flood can be used for DoS testing (ethically only on your own network).
tracerouteTrace network path to destination, showing each hop (router) and round-trip time. Uses TTL expiration (ICMP Time Exceeded).traceroute [options] <host>
M <max hops>NW <timeout>Q <probes>ITP <port>F
Maximum number of hops (default 30)nullnullnullnullnullnullnull
nullNumeric output (no DNS lookups)nullnullnullnullnullnull
nullnullWait time per probe (seconds)nullnullnullnullnull
nullnullnullProbes per hop (default 3)nullnullnullnull
nullnullnullnullUse ICMP echo instead of UDPnullnullnull
nullnullnullnullnullUse TCP SYN packets (port 80)nullnull
nullnullnullnullnullnullDestination port for UDP/TCP probesnull
nullnullnullnullnullnullnullFirst TTL (start from this hop)
Lines: hop_number host_name (IP) probe1_ms probe2_ms probe3_ms [* = timeout]
  • mtr
  • tracepath
  • ping
Shows path and latency per hop. Each hop decrements TTL; TTL=0 returns ICMP Time Exceeded. Some routers block ICMP, showing * (but path still exists). Use traceroute -I if UDP blocked. mtr combines traceroute + ping for continuous monitoring.

Fields

The shape of this dataset, read from the data itself: every column, its type and a real value. Agents can use this to plan a query without fetching the whole document.

SectionFieldTypeExample
commandsnamestringcurl
commandspurposestringTransfer data from or to a server using various…
commandscommon_usagestringcurl [options] <URL>
commandsimportant_optionsarray[12 items]
commandsexample_output_typestringHTTP response body, headers, or status code (wi…
commandsrelated_commandsarray[3 items]
commandsnotesstringcurl doesn't follow redirects by default (-L). …

Fetch the same bytes

The static files contain the same reference rows as the API, with no API rate limit. Live metadata, such as view counts, may differ. Use the API for content negotiation; use the static files for a cacheable snapshot.

curl "https://yjtoon.yunusemrevurgun.com/api/dataset/unix-networking-commands?format=toon"
const res = await fetch(
  "https://yjtoon.yunusemrevurgun.com/static-data/dataset/unix-networking-commands.toon"
);
const toon = await res.text();

Rate limit: 120 requests per minute per IP, no key and no signup. API reference →

Topics

  • unix
  • linux
  • networking
  • curl
  • wget
  • dns
  • ports

Search the library

Search by a topic, title, or keyword.

Start with a collection

Browse all 205 datasets