This cheat sheet collects commands for daily administration on AlmaLinux 9 and 10. Placeholders such as PACKAGE are for you to replace. Most commands that change the system need root, so they are shown with sudo.
| Task | Command |
|---|
| Show the AlmaLinux release | cat /etc/almalinux-release |
| Turn on the CRB repository | sudo dnf config-manager --set-enabled crb |
| Add EPEL packages | sudo dnf install epel-release |
| Install only security updates | sudo dnf upgrade --security |
| Check whether a reboot is needed after updates | sudo dnf needs-restarting -r |
| Inspect the last transaction | dnf history info last |
| Pick a module stream (AlmaLinux 9 only) | sudo dnf module enable nodejs:22 |
| Find the package that ships a binary | dnf provides '*bin/ss' |
| Task | Command |
|---|
| Is a package installed | rpm -q PACKAGE |
| List files of an installed package | rpm -ql PACKAGE |
| Which package owns a file | rpm -qf /usr/bin/bash |
| Show installed package details | rpm -qi PACKAGE |
| Task | Command |
|---|
| Start a service | sudo systemctl start SERVICE |
| Stop a service | sudo systemctl stop SERVICE |
| Enable at boot and start now | sudo systemctl enable --now SERVICE |
| Show service status | systemctl status SERVICE |
| Read a service’s log | journalctl -u SERVICE |
| Follow the log live | journalctl -f |
| Set the hostname | sudo hostnamectl set-hostname NAME |
| Set the time zone | sudo timedatectl set-timezone AREA/CITY |
| Task | Command |
|---|
| Create a user with a home directory | sudo useradd -m USER |
| Add a user to the wheel (sudo) group | sudo usermod -aG wheel USER |
| Lock a user’s password | sudo passwd -l USER |
| Delete a user and the home directory | sudo userdel -r USER |
| Change file mode | chmod 640 FILE |
| Change file owner | sudo chown USER:GROUP FILE |
| Task | Command |
|---|
| Show addresses briefly | ip -br addr |
| Show listening TCP ports | ss -ltn |
| Show NetworkManager connections | nmcli connection show |
| Allow a service through firewalld | sudo firewall-cmd --permanent --add-service=SERVICE |
| Reload firewalld rules | sudo firewall-cmd --reload |
| Task | Command |
|---|
| Show the SELinux mode | getenforce |
| Show detailed SELinux status | sestatus |
| Restore default file contexts | sudo restorecon -Rv DIR |
| Task | Command |
|---|
| Disk usage by filesystem | df -h |
| Directory size | du -sh DIR |
| Block devices | lsblk |
| Memory usage | free -m |
| Running processes | ps aux |
| Live process view | top |
| Task | Command |
|---|
| AlmaLinux release | cat /etc/almalinux-release |
| Kernel version | uname -r |
| Architecture | uname -m |
| Uptime | uptime |
The commands in this sheet were checked in the official almalinux:9 and almalinux:10 container images on 2026-10-16: the tools were installed with DNF and each command was found on the path. Read-only DNF and RPM queries were run, and user creation, locking, group changes and deletion were run. Service control, firewalld rules and SELinux changes need a full system with systemd and were not run in a container, so test them on a non-production machine first.