Linux / Arch / CachyOS

CachyOS & Linux
cheat sheet.

From installing packages to finding a stubborn process. Everyday commands for your Linux system, in one place.

Commands
120
Categories
10

120 of 120 commands

Pacman

19 commands
sudo pacman -Syu

Synchronize repositories and upgrade all packages (full system update).

sudo pacman -S <package>

Install a package from the official repositories.

sudo pacman -R <package>

Remove a package but keep its dependencies.

sudo pacman -Rs <package>

Remove a package and its unused dependencies.

sudo pacman -Rns <package>

Caution: Remove a package, its unused dependencies, and config files.

pacman -Ss <keyword>

Search for a package in the remote repositories.

pacman -Qs <keyword>

Search among locally installed packages.

pacman -Qi <package>

Display detailed information about an installed package.

pacman -Si <package>

Display detailed information about a remote package.

pacman -Ql <package>

List all files installed by a package.

pacman -Qo /path/to/file

Find out which package owns a specific file.

pacman -Qdt

List all orphaned packages (installed as dependencies, no longer needed).

sudo pacman -Rns $(pacman -Qdtq)

Caution: Remove all orphaned packages and their config files.

sudo pacman -Sc

Remove old packages from the package cache.

sudo pacman -Scc

Caution: Remove all cached packages from the cache directory.

sudo pacman -U <package.pkg.tar.zst>

Install a package from a local file.

sudo pacman -Sy

Caution: Refresh the package database without upgrading. Avoid using this alone: later installs can cause unsupported partial upgrades. Use sudo pacman -Syu for normal updates.

pacman -Qu

List all packages with available upgrades.

pacman -Qe

List all explicitly installed packages with their versions. Use pacman -Qqe for package names only when backing up your package list.

AUR (paru / yay)

9 commands
paru -Syu

Update all packages including AUR packages with paru.

paru -S <package>

Install a package from the AUR or official repos with paru.

paru -Ss <keyword>

Search for a package in AUR and official repositories.

paru --fm nano -S <package>

Install from AUR and open PKGBUILD in nano before building.

yay -Syu

Update all packages including AUR packages with yay.

yay -S <package>

Install a package from the AUR or official repos with yay.

yay -Ss <keyword>

Search AUR and official repos for a package.

paru -Gc <package>

View AUR comments for a package (paru only).

yay --devel -Syu

Updates AUR git-based packages (those ending in -git) to their latest commit.

File System

12 commands
ls -la

List all files (including hidden) with detailed permissions and metadata.

cd /path/to/dir

Change the current working directory.

pwd

Print the full path of the current working directory.

mkdir -p /path/to/dir

Create a directory and all parent directories as needed.

cp -r source dest

Copy a file or directory recursively to the destination.

mv source dest

Move or rename a file or directory.

rm -rf /path

Caution: Forcefully remove a file or directory and all its contents. Irreversible!

touch filename

Create an empty file or update the timestamp of an existing one.

ln -s /target /link

Create a symbolic link pointing to the target.

tree -L 2

Show the directory structure as a tree, 2 levels deep.

du -sh /path

Show total disk usage of a directory in human-readable form.

df -h

Show disk space usage of all mounted filesystems.

System & Hardware

12 commands
uname -a

Print all system information: kernel, hostname, OS, architecture.

hostnamectl

Show system hostname, kernel, OS, and architecture details.

lscpu

Display detailed CPU architecture and core information.

free -h

Show RAM and swap usage in human-readable format.

lsblk

List all block devices (disks and partitions) with their mount points.

lspci

List all PCI devices (GPU, network cards, etc.).

lsusb

List all USB devices currently connected to the system.

inxi -Fxz

Display a full, detailed hardware and software system summary.

sudo dmesg | tail -50

Show the last 50 kernel log messages (useful for hardware debugging).

reboot

Caution: Reboot the system immediately.

sudo systemctl poweroff

Caution: Shut down and power off the system.

timedatectl

Show or set the system time, date, and timezone.

Process Management

13 commands
htop

Interactive process viewer — shows CPU, RAM usage per process.

ps aux

List all currently running processes with user, PID, CPU/RAM.

ps aux | grep <process>

Search for a running process by name.

kill -9 <PID>

Caution: Forcefully terminate a process by its PID. Use with caution!

killall <process>

Caution: Kill all running instances of a process by name.

systemctl status <service>

Check the status of a systemd service.

sudo systemctl start <service>

Start a systemd service.

sudo systemctl stop <service>

Stop a running systemd service.

sudo systemctl restart <service>

Restart a systemd service.

sudo systemctl enable --now <service>

Enable a service to start at boot and start it immediately.

sudo systemctl disable <service>

Disable a service from starting at boot.

journalctl -xe

Show the most recent systemd journal logs with explanations.

journalctl -u <service> -f

Follow live log output of a specific systemd service.

Network

12 commands
ip a

Show all network interfaces and their IP addresses.

ip r

Display the IP routing table (shows default gateway etc.).

ping -c 4 <host>

Send 4 ICMP packets to a host to test connectivity.

curl -I https://example.com

Fetch and display HTTP response headers from a URL.

wget https://example.com/file

Download a file from the internet.

ss -tulnp

Show all listening TCP/UDP ports with associated processes.

nmcli device wifi list

List all available Wi-Fi networks.

nmcli device wifi connect <SSID> password <PASS>

Connect to a Wi-Fi network using NetworkManager CLI.

traceroute <host>

Trace the network path (hops) to a remote host.

dig <domain>

Query DNS records for a domain.

ssh <user>@<host>

Connect to a remote host via SSH.

scp <file> <user>@<host>:/remote/path

Securely copy a file to a remote host over SSH.

Users & Permissions

10 commands
chmod 755 file

Set file permissions to rwxr-xr-x (owner: rwx, group/others: r-x).

chmod -R 755 /dir

Recursively change permissions of all files in a directory.

chown <user>:<group> file

Change the owner and group of a file or directory.

sudo chown -R <user>:<group> /dir

Caution: Recursively change owner and group of a directory.

whoami

Print the current logged-in username.

id <user>

Show UID, GID, and all group memberships for a user.

sudo useradd -m -G wheel <username>

Create a new user with a home directory and add them to the wheel (sudo) group.

sudo passwd <username>

Change the password of a user.

sudo usermod -aG <group> <user>

Add a user to a supplementary group without removing existing groups.

sudo visudo

Caution: Safely edit the /etc/sudoers file to manage sudo privileges.

Text & Search

12 commands
cat file

Print the contents of a file to the terminal.

less file

View a file with scrolling support (q to quit, / to search).

grep -r 'pattern' /path

Recursively search for a text pattern in all files under a path.

grep -rn 'pattern' /path

Recursively search and show matching line numbers.

find /path -name 'filename'

Find files matching a name pattern under a given path.

find /path -type f -mtime -7

Find all files modified in the last 7 days.

sed -i 's/old/new/g' file

Replace all occurrences of 'old' with 'new' in a file in-place.

awk '{print $1}' file

Print the first column/field from each line of a file.

tail -f /var/log/file

Continuously follow and display new lines appended to a log file.

head -n 20 file

Print the first 20 lines of a file.

sort file | uniq -c | sort -rn

Count and sort unique occurrences of lines in a file.

wc -l file

Count the number of lines in a file.

CachyOS Specific

14 commands
cachyos-hello

Open the CachyOS Hello welcome app for post-install setup.

sudo pacman -S linux-cachyos

Install the default CachyOS optimized kernel.

sudo pacman -S linux-cachyos-bore

Install the CachyOS kernel with the BORE scheduler for desktop responsiveness.

sudo pacman -S linux-cachyos-eevdf

Install the CachyOS kernel with the EEVDF scheduler.

sudo pacman -S cachyos-settings

Install CachyOS system settings/tweaks for performance optimization.

sudo cachyos-rate-mirrors

Automatically rate and select the fastest CachyOS mirrors.

sudo rate-mirrors --allow-root --protocol https arch | sudo tee /etc/pacman.d/mirrorlist

Rate Arch mirrors by speed and write the sorted list to mirrorlist.

sudo mkinitcpio -P

Regenerate all initramfs images (required after kernel/hook changes).

sudo grub-mkconfig -o /boot/grub/grub.cfg

Regenerate the GRUB configuration file (e.g., after kernel change).

sudo bootctl update

Update the systemd-boot EFI bootloader.

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Check the current CPU frequency scaling governor.

echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

Set all CPU cores to 'performance' governor for maximum speed.

sudo systemctl enable --now ananicy-cpp

Enable and start ananicy-cpp for automatic process priority management.

sudo systemctl enable --now irqbalance

Enable IRQ balancing across CPU cores for better performance.

Archives & Compression

7 commands
tar -czvf archive.tar.gz /path

Create a gzip-compressed tar archive from a directory or file.

tar -xzvf archive.tar.gz

Extract a gzip-compressed tar archive in the current directory.

tar -xzvf archive.tar.gz -C /dest

Extract a tar archive into a specific destination directory.

tar -cJvf archive.tar.xz /path

Create a highly-compressed XZ tar archive.

zip -r archive.zip /path

Create a ZIP archive from a file or directory.

unzip archive.zip -d /dest

Extract a ZIP archive to a destination directory.

7z x archive.7z

Extract a 7-Zip archive in the current directory.