Networking — Network configuration and diagnostics
curl
Networking
Transfer data from or to a server
Syntax
curl [OPTIONS] URL
Examples
curl https://example.com
curl -o file.zip https://example.com/file.zip
curl -I https://example.com
curl -X POST -d '{"key":"val"}' -H "Content-Type: application/json" https://api.example.com
Common Flags
-o FILE save to file
-O save with remote filename
-I headers only
-L follow redirects
-s silent mode
-X METHOD set HTTP method
-d DATA POST data
-H add header
ip
Networking
Show and manipulate network interfaces and routing
Syntax
ip [OPTIONS] OBJECT COMMAND
Examples
ip addr ip addr show eth0 ip route ip link
Common Flags
addr IP addresses
route routing table
link network interfaces
netstat
Networking
Print network connections and statistics
Syntax
netstat [OPTIONS]
Examples
netstat -tulpn netstat -an | grep :80
Common Flags
-t TCP connections
-u UDP connections
-l listening sockets
-p show PID/program name
-n numeric addresses (no DNS lookup)
Notes
ss is a modern replacement for netstat and is faster.
nmap
Networking
Network exploration and port scanning tool
Syntax
nmap [OPTIONS] HOST
Examples
nmap 192.168.1.1 nmap -p 80,443 example.com nmap -sV example.com
Common Flags
-p PORTS scan specific ports
-sV detect service versions
-O OS detection
-A aggressive scan (OS, version, scripts)
Notes
Only scan networks you have permission to scan.
ping
Networking
Send ICMP ECHO_REQUEST packets to a host
Syntax
ping [OPTIONS] HOST
Examples
ping google.com ping -c 4 google.com ping -i 0.5 google.com
Common Flags
-c N stop after N packets
-i N interval between packets (seconds)
scp
Networking
Securely copy files between hosts
Syntax
scp [OPTIONS] SOURCE DEST
Examples
scp file.txt user@host:/tmp/ scp user@host:/var/log/app.log . scp -r ./mydir user@host:/home/user/
Common Flags
-r copy recursively
-P PORT port number
-i FILE identity file
ss
Networking
Investigate sockets (modern netstat replacement)
Syntax
ss [OPTIONS]
Examples
ss -tulpn ss -an | grep :80
Common Flags
-t TCP
-u UDP
-l listening
-p show processes
-n numeric
ssh
Networking
OpenSSH remote login client
Syntax
ssh [OPTIONS] [USER@]HOST
Examples
ssh alice@example.com ssh -p 2222 user@host ssh -i ~/.ssh/key.pem user@host
Common Flags
-p PORT connect to specific port
-i FILE identity (private key) file
-L local port forwarding
-v verbose (for debugging)
wget
Networking
Non-interactive network downloader
Syntax
wget [OPTIONS] URL
Examples
wget https://example.com/file.zip wget -O output.zip https://example.com/file.zip wget -r https://example.com
Common Flags
-O FILE save to specific filename
-r recursive download
-q quiet mode
-c continue interrupted download