Systemd vs OpenRC

linux

Service management commands for both init systems

Service Control

systemd OpenRC Description
systemctl start nginx rc-service nginx start Start a service
systemctl stop nginx rc-service nginx stop Stop a service
systemctl restart nginx rc-service nginx restart Restart a service
systemctl status nginx rc-service nginx status Check status
systemctl enable nginx rc-update add nginx default Enable at boot
systemctl disable nginx rc-update del nginx default Disable at boot

System Information

systemd OpenRC Description
systemctl list-units rc-status List running services
systemctl list-unit-files rc-update show List all services
journalctl -u nginx cat /var/log/nginx/*.log View service logs
journalctl -f tail -f /var/log/messages Follow system logs

Docker Essential Commands

docker

Common Docker operations for containers, images, and networks

docker ps List running containers
docker ps -a List all containers (including stopped)
docker images List local images
docker pull nginx:latest Pull an image from registry
docker run -d --name web -p 80:80 nginx Run container in background with port mapping
docker exec -it web /bin/bash Execute interactive shell in container
docker logs -f web Follow container logs
docker stop web && docker rm web Stop and remove container
docker system prune -a Remove all unused data (images, containers, networks)
docker network ls List networks
docker network create mynet Create a network
docker volume ls List volumes
docker inspect web View detailed container info
docker stats Live resource usage stats
docker compose up -d Start compose stack in background
docker compose down -v Stop and remove stack with volumes
docker compose logs -f Follow compose stack logs
docker compose pull Pull latest images for stack

Kubernetes kubectl Commands

kubernetes

Essential kubectl commands for cluster management

kubectl get pods List pods in current namespace
kubectl get pods -A List pods in all namespaces
kubectl get pods -o wide List pods with node info
kubectl describe pod mypod Detailed pod information
kubectl logs mypod -f Follow pod logs
kubectl logs mypod -c mycontainer Logs from specific container
kubectl exec -it mypod -- /bin/bash Interactive shell in pod
kubectl apply -f manifest.yaml Apply configuration
kubectl delete -f manifest.yaml Delete resources from file
kubectl get svc List services
kubectl get deploy List deployments
kubectl get nodes List cluster nodes
kubectl top pods Resource usage by pods
kubectl top nodes Resource usage by nodes
kubectl rollout restart deploy/myapp Restart deployment
kubectl rollout status deploy/myapp Watch rollout progress
kubectl scale deploy/myapp --replicas=3 Scale deployment
kubectl port-forward svc/myapp 8080:80 Forward local port to service
kubectl get events --sort-by=.lastTimestamp Recent cluster events
kubectl config get-contexts List available contexts
kubectl config use-context mycluster Switch context

Git Workflow Commands

git

Common Git operations for version control

git status Show working tree status
git add . Stage all changes
git commit -m 'message' Commit with message
git push origin main Push to remote
git pull --rebase Pull with rebase
git fetch --all Fetch all remotes
git branch -a List all branches
git checkout -b feature/new Create and switch to branch
git merge feature/new Merge branch into current
git rebase main Rebase current branch onto main
git log --oneline -10 Show last 10 commits (short)
git log --graph --oneline Show commit graph
git diff Show unstaged changes
git diff --staged Show staged changes
git stash Stash current changes
git stash pop Apply and remove stash
git reset --soft HEAD~1 Undo last commit, keep changes staged
git reset --hard HEAD~1 Undo last commit, discard changes
git cherry-pick abc123 Apply specific commit
git remote -v List remotes with URLs

SSH Quick Reference

networking

SSH connections, tunnels, and key management

ssh user@host Basic SSH connection
ssh -p 2222 user@host Connect on non-standard port
ssh -i ~/.ssh/mykey user@host Connect with specific key
ssh -L 8080:localhost:80 user@host Local port forward
ssh -R 8080:localhost:80 user@host Remote port forward
ssh -D 1080 user@host SOCKS proxy
ssh -J jump@bastion user@target Jump host / ProxyJump
ssh-keygen -t ed25519 -C 'comment' Generate ED25519 key
ssh-copy-id user@host Copy public key to host
ssh-add ~/.ssh/mykey Add key to agent
ssh-keyscan host >> ~/.ssh/known_hosts Add host key
scp file.txt user@host:/path/ Copy file to remote
scp user@host:/path/file.txt . Copy file from remote
rsync -avz src/ user@host:/dest/ Sync directory to remote

Network Debugging

networking

Commands for troubleshooting network issues

ip addr Show IP addresses
ip route Show routing table
ip link Show network interfaces
ss -tulpn Show listening ports
ss -s Socket statistics summary
ping -c 4 host Ping host (4 packets)
traceroute host Trace route to host
mtr host Combined ping/traceroute
dig domain.com DNS lookup
dig @8.8.8.8 domain.com DNS lookup with specific server
nslookup domain.com Simple DNS lookup
curl -I https://example.com HTTP headers only
curl -v https://example.com Verbose HTTP request
wget -O- https://example.com Download to stdout
nc -zv host 80 Test TCP port connectivity
tcpdump -i eth0 port 80 Capture packets on port 80
iptables -L -n -v List firewall rules
nft list ruleset List nftables rules

ZFS Storage Commands

storage

ZFS pool and dataset management

zpool status Show pool health status
zpool list List pools with capacity
zpool import List importable pools
zpool import -f tank Force import pool
zpool export tank Export pool
zpool scrub tank Start scrub
zpool history tank Show pool history
zfs list List datasets
zfs list -t snapshot List snapshots
zfs create tank/data Create dataset
zfs snapshot tank/data@backup Create snapshot
zfs rollback tank/data@backup Rollback to snapshot
zfs destroy tank/data@backup Delete snapshot
zfs send tank/data@snap | ssh host zfs recv tank/data Send snapshot to remote
zfs get all tank/data Show all properties
zfs set compression=lz4 tank/data Enable compression
zfs set quota=100G tank/data Set quota

Tailscale VPN Commands

networking

Tailscale mesh VPN management

tailscale status Show connection status
tailscale ip Show Tailscale IP
tailscale ping hostname Ping via Tailscale
tailscale up Connect to network
tailscale down Disconnect from network
tailscale up --ssh Enable Tailscale SSH
tailscale up --advertise-routes=10.0.0.0/24 Advertise subnet
tailscale up --accept-routes Accept advertised routes
tailscale up --exit-node=hostname Use exit node
tailscale netcheck Network connectivity check
tailscale debug derp-map Show DERP relay servers
tailscale file send file.txt hostname: Send file via Taildrop
tailscale logout Log out and disconnect

Disk & Filesystem Commands

storage

Disk management and filesystem operations

lsblk List block devices
lsblk -f List with filesystem info
fdisk -l List partitions
df -h Disk space usage
du -sh /path Directory size
du -sh * | sort -h Sorted directory sizes
ncdu /path Interactive disk usage
mount /dev/sdb1 /mnt Mount filesystem
umount /mnt Unmount filesystem
blkid Show UUIDs and labels
mkfs.ext4 /dev/sdb1 Create ext4 filesystem
e2fsck -f /dev/sdb1 Check ext4 filesystem
tune2fs -l /dev/sdb1 Show ext4 superblock info
smartctl -a /dev/sda SMART health data
hdparm -tT /dev/sda Test disk speed
fstrim -v / TRIM SSD

Process Management

linux

Process monitoring and control

ps aux List all processes
ps aux | grep nginx Find specific process
pgrep -a nginx Find process by name
top Interactive process viewer
htop Better interactive viewer
kill PID Graceful kill (SIGTERM)
kill -9 PID Force kill (SIGKILL)
pkill nginx Kill by name
killall nginx Kill all with name
nice -n 10 command Run with lower priority
renice -n 10 -p PID Change priority
nohup command & Run immune to hangups
command & Run in background
jobs List background jobs
fg %1 Bring job to foreground
bg %1 Resume job in background