tags:
- linux
- programming
- reference
- formulation
- software
created: 2024-08-23
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'
List the detected block devices and their identifiers:
$ blkid
Merging multiple PDF documents into a single PDF document:
$ pdfunite <file 1> <file 2> <output pdf>
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
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
Starting a service:
$ rc-service <service name> start
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>'
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
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>
Change the keyboard layout to the United States International layout:
$ setxkbmap -layout us -variant intl