/IT Cheatsheets
Fast, cross-platform command reference. Press '/' to search.
Local processing
This tool processes your input in your browser.
Command Palette
Search for a command to run...
Networking
Display the current IP routing table
ip route show
Display interface IP addresses
ip addr show
List all listening ports and their associated process IDs
ss -tulpn
Query specific DNS server for domain information
dig @8.8.8.8 example.com
Flush the systemd-resolved DNS cache
resolvectl flush-caches
Display the current IP routing table
route print
Display full TCP/IP configuration for all adapters
ipconfig /all
Query specific DNS server for domain information
nslookup example.com 8.8.8.8
Flush and reset the DNS client resolver cache
ipconfig /flushdns
Test network connectivity and specific port (PowerShell)
Test-NetConnection -ComputerName 8.8.8.8 -Port 53
Display the current IP routing table
show ip route
Display a brief summary of interface statuses and IP addresses
show ip interface brief
Show the current active configuration
show running-config
Save the running config to the startup config (NVRAM)
write memory
Show the MAC address table of the switch
show mac address-table
Show detailed information about directly connected Cisco devices
show cdp neighbors detail
Display the current IP routing table
ip route print
Display interface IP addresses
ip address print
Export the full configuration to a readable script file
export file=backup.rsc
Display the full IP routing table
get router info routing-table all
System Administration
Add an existing user to the sudo group
usermod -aG sudo username
Recursively set directory permissions to rwxr-xr-x
chmod -R 755 /path/to/dir
Recursively change the owner and group of a directory
chown -R user:group /path/to/dir
Find and delete log files older than 30 days
find /var/log -type f -name "*.log" -mtime +30 -exec rm {} \;Find and delete empty directories
find . -type d -empty -delete
Interactive process viewer and system monitor
htop
Report file system disk space usage in human-readable format
df -h
Estimate file space usage for all files in current directory
du -sh *
View the end of the logs for a specific systemd service
journalctl -xeu service_name
Compress a folder into a gzip tarball
tar -czvf archive.tar.gz /path/to/folder
Show top 10 processes consuming the most CPU (PowerShell)
Get-Process | Sort-Object CPU -Descending | Select-Object -First 10
Get the 50 most recent security events (PowerShell)
Get-EventLog -LogName Security -Newest 50
Scan the integrity of all protected system files and replace incorrect versions
sfc /scannow
List all local users (PowerShell)
Get-LocalUser
Clear the DNS cache (PowerShell)
Clear-DnsClientCache
Show system resources (CPU, RAM, Uptime)
system resource print
Display general system status, firmware version, and uptime
get system status
Security
Allow incoming SSH traffic using UFW
ufw allow 22/tcp
List all iptables rules with packet counts (no DNS resolution)
iptables -L -v -n
Find failed SSH login attempts
grep "Failed password" /var/log/auth.log
Show all configured access lists and hit counts
show access-lists
Print firewall filter rules
ip firewall filter print
Capture packets (tcpdump equivalent) for a specific IP with high verbosity
diag sniffer packet any 'host 1.1.1.1' 4 0 l
Show all firewall policies
show firewall policy
Aggressive, fast scan with OS detection, version detection, script scanning, and traceroute
nmap -A -T4 <ip>
Scan all 65535 ports
nmap -p- <ip>
View the contents of a PEM encoded certificate
openssl x509 -in cert.pem -text -noout
Generate a new 2048-bit RSA private key
openssl genrsa -out private.key 2048
Containers
List all containers (running and stopped)
docker ps -a
Get an interactive shell inside a running container
docker exec -it <container_name> /bin/bash
Remove all unused containers, networks, images, and volumes
docker system prune -a
Follow log output of a container
docker logs -f <container_name>
Build, (re)create, start, and detach for containers using docker-compose
docker compose up -d
Version Control
View a visual tree of all branches and commits
git log --oneline --graph --decorate --all
Discard all local changes in the working directory
git reset --hard HEAD
Remove all untracked files and directories
git clean -fd
Stash changes in a dirty working directory
git stash
Create and switch to a new branch
git checkout -b <new-branch-name>
Kubernetes
List all pods in all namespaces
kubectl get pods --all-namespaces
Tail the logs for a specific pod
kubectl logs -f <pod-name>