Automation

Restart nginx when a server configuration is modified:

$ find /etc/nginx/sites-enabled/ | entr -s 'nginx -s reload'

Run a command when a file in a directory is modified:

$ find [directory] | entr -s 'command'

Run a command when a file tracked by git is modified:

$ git ls-files -m | entr -s 'command'

Disks

List the detected block devices and their identifiers:

$ blkid

Documents

Merging multiple PDF documents into a single PDF document:

$ pdfunite <file 1> <file 2> <output pdf>

File Management

Copying files from one directory to another but better:

$ rsync -ahr --progress --info=progress2 --ignore-existing <source directory> <destination directory>

Remove cached packages from pacman:

$ sudo pacman -Scc

Git

Run a git command as if you were in a directory:

$ git -C <file path> <action> <arguments>

Push an empty git commit:

$ git commit --allow-empty -m "<message>"
$ git push 

OpenRC

Starting a service:

$ rc-service <service name> start

Media

Playing a YouTube video through the command line:

$ yt-dlp -o - '<video URL>' | ffplay -

Playing a YouTube video through the command line:

$ mpv '<video URL>'

Text Manipulation

Return one copy of each line in a file:

$ awk '!seen[$0]++' [file]

Return one copy of each line in a file in sorted order:

$ sort [file] | uniq

User Management

Delete a user and their home directory:

$ sudo deluser --remove-home <user>

Delete a user and all files which are owned by that user (including on every mounted block device):

$ sudo deluser --remove-all-files <user>

X

Change the keyboard layout to the United States International layout:

$ setxkbmap -layout us -variant intl