Start here: Ubuntu Server & Linux cheat sheets
Cheat sheets and short guides for running Ubuntu Server, most of them useful on any Linux. What's in here, who it's for, and where to find what.
What this is
A collection of cheat sheets and short guides for running a Linux server. It is not a manual and not a course. Every page answers one question in a few minutes, so you can get going quickly or look up the command you forgot.
Most pages have the same shape:
- A few lines of explanation: what is going on and why.
- A cheat sheet: the commands you came for, ready to copy.
- Gotchas: the things that usually go wrong.
Just need the command? Jump to the cheat sheet with the table of contents on the right. Want to understand the topic? The concept pages (like how disks, partitions and volumes fit together) explain the basics briefly.
Who it’s for
IT admins who can already log in, move around the shell and edit a file, but don’t work with Linux every day. You don’t want to read a hundred lines to change an IP or grow a disk.
Ubuntu or Linux in general?
Everything is written and tested for Ubuntu Server 22.04 and 24.04 LTS and newer. Most of it works on any Linux, because the shell, the tools and the core concepts are the same everywhere. Where Ubuntu does its own thing, the page says so.
| Applies to | Topics |
|---|---|
| Any Linux | Shell and terminal, everyday commands, permissions, LVM and file systems, systemd services and journal, cron, Bash scripting, and all tools (vim, git, ssh, curl, jq, find, sed/awk, tmux…) |
| Ubuntu / Debian | Packages (apt), adduser/deluser, the sudo group, ufw, log file names like /var/log/auth.log |
| Ubuntu specific | Network config with Netplan, the installer’s default LVM layout, cloud-init defaults |
On Red Hat-based systems (RHEL, Rocky, Alma) the differences are mostly dnf instead of apt, the group wheel instead of sudo, firewalld instead of ufw, NetworkManager (nmcli) instead of Netplan, and /var/log/secure instead of auth.log.
Where to find what
| Section | What’s inside |
|---|---|
| Core Concepts And Tips | sudo, getting help, everyday commands (ls, grep, tar), terminal shortcuts, shell history, pipes and operators, “everything is a file”, the folder layout, packages and updates |
| Disks And Volumes | How disks, partitions, LVM and file systems fit together. List, create, delete, mount and extend them. File systems compared. Find and free space when a disk is full. |
| Networking | Netplan, IP address, gateway and routes, DNS, and network troubleshooting |
| User Management | Users, groups, file permissions, ACLs and best practices |
| Logs And Debugging | Where the logs are, how to search them, login problems, slow boots, and journalctl in depth |
| Services And Cronjobs | Check, start and autostart services, cronjobs, and the “task manager” for CPU, RAM and disk |
| Automation | Bash scripting basics, best practices, and a complete example script |
| Tools And Utilities | Cheat sheets for vim, xargs, find, sed and awk, git, curl, jq, ssh, tmux, and lsof/ss/ncdu |
I just need to…
| Task | Page |
|---|---|
| Run a command as root | Who is sudo? |
| Find a command I forgot | Stuck? Where to get help |
| Extract a .tar.gz | Everyday commands |
| See all disks and free space | List disks and volumes |
| Extend a disk or volume | Extend a disk or volume |
| Disk is full, find out why | Disk full: find and free space |
| Add and mount a new disk | Partitions and Format and mount |
| Change the IP address | Change IP, gateway and routes |
| Change the DNS server | Where are the DNS settings? |
| Create a user and give admin rights | Users |
| Fix “Permission denied” | How permissions work |
| Set up a shared folder for a team | Permission best practices |
| Find the right log | Where are the logs? |
| Find out why someone can’t log in | Debugging login problems |
| Find out why the boot is slow | Slow boot? systemd-analyze |
| Check if a service runs, enable autostart | Services |
| Schedule a job | Cronjobs |
| See what eats CPU or RAM | Task manager |
| Write a script | Bash scripting basics |
| Edit a file in vim (and get out again) | Vim: survival basics |
| Find files by name, age or size | find |
| Replace text in many files | sed and awk |
| Run a command for many files | xargs snippets |
| Keep a job running when SSH drops | tmux |
| Find which process uses a port | lsof, ss and ncdu |
| Test a website or API | curl |
Conventions
sudoin front of a command means it needs root rights.- Placeholders are written in capitals, like
USERNAMEor/dev/sdX. Replace them. sdb,ens18and192.168.10.xare examples. Your disk and interface names will differ, so always check them first.
Warning: Commands on the disk pages can destroy data. Read the device name twice before you press Enter, and have a backup or snapshot.