Linux/OpenBSD Cheatsheet
Nov 04, 2023
Linux and OpenBSD do share a great deal of common commands and core utilities, albeit with different implementations.
However, there are some obvious differences, due to the ways these systems work.
This page contains a cheatsheet for common commands, operations and files on OpenBSD and Linux (primarily Red Hat family) systems, which covers some of these differences.
General Commands
Linux | OpenBSD |
sudo | doas |
sudo su | doas su |
lsof | fstat |
lsblk | sysctl hw.disknames |
ip a | ifconfig |
lspci | pcidump |
adduser <username> | useradd -m <username> |
deluser <username> | userdel <username> |
Service Management
Linux | OpenBSD |
systemctl stop <service> | rcctl stop <service> |
systemctl start <service> | rcctl start <service> |
systemctl status <service> | rcctl check <service> |
systemctl reload <service> | rcctl reload <service> |
systemctl enable <service> | rcctl enable <service> |
systemctl disable <service> | rcctl disable <service> |
systemctl restart <service> | rcctl restart <service> |
systemctl list-units --type=service | rcctl ls all |
systemctl list-units --type=service --state=running | rcctl ls started |
systemctl list-units --type=service --state=enabled | rcctl ls on |
Firewall & Networking
Linux | OpenBSD |
systemctl reload firewalld | pfctl -f /etc/pf.conf |
systemctl enable firewalld | pfctl -e |
systemctl disable firewalld | pfctl -d |
firewall-cmd --list-all | pfctl -sr |
firewall-cmd --add-port=... | vi /etc/pf.conf |
firewall-cmd --runtime-to-permanent | - |
systemctl restart network | sh /etc/netstart |
less /var/log/firewalld | tcpdump -n -e -ttt -r /var/log/pflog |
Packages & Upgrades
Linux | OpenBSD |
yum/dnf install | pkg_add |
yum/dnf update | pkg_add -u |
yum/dnf remove | pkg_delete |
yum/dnf autoremove | pkg_delete -a |
yum/dnf search | pkg_info -Q |
- | syspatch -c |
- | syspatch |
system-upgrade/dist-upgrade | sysupgrade |
Important Files
Linux | OpenBSD |
.bashrc | .kshrc |
/etc/sudoers | /etc/doas.conf |
/etc/sysconfig/network-scripts/ifcfg-<interface> | /etc/hostname.<interface> |
/etc/firewalld/firewalld.conf | /etc/pf.conf |
/var/log/secure | /var/log/authlog |
/var/log/nginx | /var/www/logs |