[Cheatsheet] Linux / UNIX
Linux / UNIX Cheatsheet
WARNING: This is a personal cheatsheet. Mostly stuff I want to lookup later. You might find more comprehensive ones somewhere else online.
OpenBSD
- rcctl [stop|start|enable|disable] [service-name] // will enable disable certain /etc/rc.conf settings and/or start/stop particular services like httpd
- doas [command] // like sudo, same same but different (note for later: where exactly is the difference btw?)
- pkg_add [package-name] // will install a package from given location/mirror
Daily Things
- rsync -aP [src] [dst] // will synchronize all data from one pace to the while kleeping all attributes and show progress.
- cat foo.txt | xargs bar.sh // will execute bar.sh for each line from foo.txt as first parameter of bar.sh
- export $(cat env.dev) // will use each line from env.dev as export value for environment variables
- tmux attach-session -t X // where X is the session number, index by 0 as first session on system
- python -m http.server // start an HTTP sever on port 8000 with just python installed.