Network Commands
Network connectivity and communication commands
ping - Network Connectivity
Network connectivity testing and diagnostics
# Ping host
ping google.com
# Ping with specific count
ping -c 4 google.com
# Ping with interval
ping -i 2 google.com
# Ping with timeout
ping -W 5 google.com
# Ping with packet size
ping -s 1000 google.com
# Ping IPv6 address
ping6 ipv6.google.com
# Ping with timestamp
ping -D google.com
Individual commands:
ping google.com
ping -c 4 google.com
ping -i 2 google.com
ping -W 5 google.com
ping -s 1000 google.com
ping6 ipv6.google.com
ping -D google.com
netstat - Network Statistics
Network connection and routing information
# Show all connections
netstat -a
# Show listening ports
netstat -l
# Show TCP connections
netstat -t
# Show UDP connections
netstat -u
# Show with process information
netstat -p
# Show with numerical addresses
netstat -n
# Show routing table
netstat -r
# Show interface statistics
netstat -i
Individual commands:
netstat -a
netstat -l
netstat -t
netstat -u
netstat -p
netstat -n
netstat -r
netstat -i
ss - Socket Statistics
Socket statistics and connection monitoring
# Show all sockets
ss -a
# Show listening sockets
ss -l
# Show TCP sockets
ss -t
# Show UDP sockets
ss -u
# Show with process information
ss -p
# Show with numerical addresses
ss -n
# Show socket statistics
ss -s
# Show sockets by state
ss -t state established
Individual commands:
ss -a
ss -l
ss -t
ss -u
ss -p
ss -n
ss -s
ss -t state established
curl/wget - File Download
File downloading and web content retrieval
# Download file with curl
curl -O https://example.com/file.txt
# Download with wget
wget https://example.com/file.txt
# Download with progress bar
curl -# -O https://example.com/file.txt
# Download with resume capability
wget -c https://example.com/file.txt
# Download with custom user agent
curl -A "Custom Agent" https://example.com/
# Download with authentication
curl -u username:password https://example.com/
# Download with headers
curl -H "Accept: application/json" https://api.example.com/
# Download with timeout
curl --max-time 30 https://example.com/
Individual commands:
curl -O https://example.com/file.txt
wget https://example.com/file.txt
curl -# -O https://example.com/file.txt
wget -c https://example.com/file.txt
curl -A "Custom Agent" https://example.com/
curl -u username:password https://example.com/
curl -H "Accept: application/json" https://api.example.com/
curl --max-time 30 https://example.com/
ssh - Remote Access
Secure remote access and file transfer
# Connect to remote host
ssh user@hostname
# Connect with specific port
ssh -p 2222 user@hostname
# Connect with key file
ssh -i ~/.ssh/id_rsa user@hostname
# Execute command remotely
ssh user@hostname "ls -la"
# Copy files with scp
scp file.txt user@hostname:/path/
# Copy directory with scp
scp -r directory/ user@hostname:/path/
# Copy from remote to local
scp user@hostname:/path/file.txt ./
# Setup SSH tunnel
ssh -L 8080:localhost:80 user@hostname
Individual commands:
ssh user@hostname
ssh -p 2222 user@hostname
ssh -i ~/.ssh/id_rsa user@hostname
ssh user@hostname "ls -la"
scp file.txt user@hostname:/path/
scp -r directory/ user@hostname:/path/
scp user@hostname:/path/file.txt ./
ssh -L 8080:localhost:80 user@hostname