Linux & Windows Command Cheat Sheet (Printable)

The commands we use every day on Debian, Ubuntu and Windows, on one page you can print or save as a PDF. Each section links to the full guide.

Updated November 2026 · Debian 13/12, Ubuntu 24.04/26.04, Windows 10/11

Linux: updates

sudo apt updateRefresh the package lists.
apt list --upgradableSee which packages have updates.
sudo apt upgradeInstall the updates. Automate security updates
sudo apt full-upgradeAlso allow updates that add or remove packages (kernels).
sudo apt autoremoveRemove packages that are no longer needed.
uname -rShow the running kernel version. Update the kernel

Linux: health checks

free -hMemory and swap; read the “available” column. Guide
df -hFree space on every disk. Guide
sudo du -sh /var/* | sort -hWhich folders use the most space.
uptime · nprocLoad average, and the number of CPU cores to compare it with. Guide
topLive list of the busiest processes (q to quit).

Linux: network

ip aYour IP addresses. Guide
ip routeYour default gateway.
sudo ss -tulnpPorts that are listening, and which program owns each. Guide
ping -c 4 example.comIs a host reachable?
nslookup example.comCheck DNS (package bind9-dnsutils on Debian 13). Guide
curl -I https://example.comCheck a website’s response and headers.

Linux: services, logs and users

systemctl status nginxIs a service running? (replace nginx with any service).
sudo systemctl restart nginxRestart a service.
journalctl -u nginx --since "1 hour ago"Recent log lines of one service.
journalctl -p err -bErrors since the last boot.
sudo adduser annaCreate a user.
sudo usermod -aG sudo annaGive a user sudo rights (log out and in again). Guide
sudo ufw status verboseFirewall rules. Guide
sudo fail2ban-client status sshdBanned IPs for SSH. Guide

Linux: files and backups

ls -lahList files with sizes, owners and hidden files.
sudo find / -xdev -size +500M 2>/dev/nullFind very large files.
tar -czf backup.tar.gz folder/Pack a folder into one compressed file.
rsync -av --dry-run src/ dest/Preview a copy; remove --dry-run to run it. Guide
sudo chown anna:anna fileChange who owns a file.

Windows: repair and troubleshooting

Open Terminal (Admin) from the Win+X menu for the commands marked “admin”.

sfc /scannowCheck and repair system files (admin).
DISM /Online /Cleanup-Image /RestoreHealthRepair the Windows image when sfc cannot fix everything (admin).
chkdsk C: /fCheck the disk for errors; runs at the next restart for C: (admin). Guide
tasklistList running programs and their PIDs.
taskkill /IM notepad.exe /FForce-close a frozen program. Guide
winget upgrade --allUpdate installed apps from the command line.
systeminfoWindows version, install date, memory and more.

Windows: network

ipconfig /allIP address, gateway, DNS servers and MAC address. Guide
ipconfig /flushdnsClear old DNS answers when a site will not load.
ping -n 4 example.comIs a host reachable?
tracert example.comWhere on the way does the connection stop?
netstat -anoOpen connections and the PID that owns each.

Windows: keyboard shortcuts

Ctrl + Shift + EscOpen Task Manager directly.
Win + Shift + SScreenshot of part of the screen. Guide
Win + VClipboard history (turn it on the first time).
Win + LLock the PC.
Win + XPower-user menu: Terminal (Admin), Device Manager, Disk Management.

From LiberianGeek.net: tested Linux, Windows and server guides since 2012. Commands can change between versions; the linked guides are kept up to date.