Linux
Networking
Inspect interfaces, ports, connections, and DNS.
By EZ4Code Team
networkipports
Code
# Interfaces and addresses
ip addr show
ip -br link
ip route
ip -s link
# Port and connection inspection
ss -tlnp # TCP listening ports + process
ss -tnp state established
netstat -tulpn # legacy alternative
# Connectivity
ping -c 4 example.com
traceroute example.com
mtr -c 10 example.com
# DNS
dig +short example.com
nslookup example.com 8.8.8.8
getent hosts example.com
# Curl and HTTP debugging
curl -sI https://example.com
curl -w "@curl-format.txt" -o /dev/null -s https://example.comExplanation
ip (from iproute2) is the modern replacement for ifconfig and route. ss is faster and more informative than netstat for showing sockets and the processes behind them. dig queries DNS records, and curl with -I fetches only headers for quick HTTP debugging. mtr combines ping and traceroute into a live view.
More Linux Snippets
File Operations
Copy, move, link, and search files efficiently.
Permissions & Ownership
Manage read/write/execute bits with chmod and chown.
Process Management
List, signal, and monitor running processes.
Package Management
Install, update, and search packages on Debian and RHEL.
Text Processing
Filter, transform, and summarize text streams.
Disk Usage
Inspect filesystems, large directories, and inodes.