Fedora Cheatsheet

CLI quick reference

System

Information

uname -aAll system information
hostnamectlHostname & details
lscpuCPU architecture
timedatectl statusSystem time

Monitoring

top / htopReal-time processes
df -hDisk usage
free -mMemory usage (MB)
kill <pid>Terminate a process

Services (systemctl)

sudo systemctl start <svc>Start service
sudo systemctl stop <svc>Stop service
sudo systemctl status <svc>Service status
journalctl -fFollow live logs
journalctl -u <unit>Logs for unit

Files

Navigation

ls / pwd / cd <dir>List / location / navigate
touch / mkdir <name>Create file / directory
cp <src> <dst>Copy file
mv <src> <dst>Move / rename
rm <file>Delete file

Permissions

chmod u+x <file>Make executable
chown [user]:[grp] <f>Change owner/group
find [dir] -name <pat>Find files
grep <pattern> <file>Search in file

Archive

tar -czvf <name.tar.gz>Compress to tar.gz
tar -xvf <name.tar.*>Extract archive
cat / less / head / tailView file contents

Users & Groups

Users

wShow logged-in users
sudo useradd <user>Create user
sudo userdel <user>Delete user
sudo passwd <user>Set password
su <user>Switch user

Groups

id / groups [user]Show IDs / groups
sudo groupadd <grp>Create group
sudo usermod -aG <grp> <u>Add user to group

Packages (DNF)

sudo dnf install <pkg>Install package
sudo dnf remove <pkg>Remove package
sudo dnf updateUpdate all packages
dnf search <pkg>Search packages
dnf info <pkg>Package details
dnf list installedList installed packages
sudo dnf autoremoveRemove unused dependencies
sudo dnf clean allClear DNF cache

Networking

General

ip addr showNetwork interfaces & IPs
ss -lListening sockets
ping <host>Ping a host
ssh <user@host>SSH to remote host
scp <src> <user@host>:<dst>Secure copy

NetworkManager (nmcli)

nmcli device statusShow network devices
nmcli connection showList connections
nmcli device wifi listList Wi-Fi networks
nmcli device wifi connect <S>Connect to Wi-Fi

Firewall (firewalld)

sudo firewall-cmd --stateFirewall status
sudo firewall-cmd --list-allShow active rules
sudo firewall-cmd --add-port=<p>/tcp --permanentAllow port
sudo firewall-cmd --reloadApply changes

SELinux

getenforce / sestatusShow SELinux mode / status
sudo setenforce 0/1Permissive / enforcing (temp)
ls -Z <file>File SELinux context
sudo restorecon -Rv <path>Restore default contexts

Podman (Containers)

podman pull <image>Pull image
podman run <image>Run container
podman ps / ps -aRunning / all containers
podman stop / rm <ctr>Stop / remove container
podman exec -it <ctr> bashShell into container
podman logs <ctr>View container logs

Key differences from Ubuntu

apt→dnf
ufw→firewalld / firewall-cmd
Netplan→nmcli (NetworkManager)
AppArmor→SELinux (enforcing)
Docker→Podman (rootless)
adduser→useradd