Starting here: BSD, not Linux
Welcome to an OpenBSD shell. This is a copyable first-reference for OpenBSD 7.9 on an ordinary Intel/AMD PC, aimed at Slackware users and newcomers. Most everyday commands will feel familiar; OS upgrades, networking tools and package management have their own BSD flavour.
In examples, $ means a command for a normal user and # means a root shell. Those characters are prompts, not part of the command to paste. Copy boxes below omit prompt characters whenever possible. Read before executing a command that modifies files or settings.
Identity, listing, man-page and network-inspection commands are suitable for experimenting. Administration, package installation and changes to services affect the computer; use them intentionally, preferably on a practice machine.
1 · Meet your system
uname -a
uname -s
sysctl kern.version
sysctl hw.ncpu
whoami
id
uptime
date
uname -a reports the kernel/architecture. sysctl kern.version shows the running kernel version; hw.ncpu reports CPU count. id reveals your user ID and group membership.
2 · Filesystem navigation
pwd
ls -la
cd /etc
pwd
cd ~
ls /usr/local
man hier
pwd prints where you are. ls -la includes hidden files and permissions. ~ is your home directory. The built-in hier(7) manual documents OpenBSD's directory layout, including /etc for configuration and /usr/local for installed third-party software.
3 · Read files without changing them
cat /etc/motd
less /etc/motd
head -n 15 /etc/passwd
tail -n 20 /var/log/messages
grep -n "root" /etc/passwd
find /usr/local/bin -name "*mutt*" 2>/dev/null
less is a pager: press q to quit. grep looks for matching lines and find searches paths. Some logs and configuration files may require root privileges to read.
4 · Create and edit your own files
Practice somewhere safe, like your home directory. These commands create a throwaway practice folder; they do not touch system configuration.
mkdir -p ~/bsd-practice
cd ~/bsd-practice
printf "Hello, OpenBSD!\n" > hello.txt
cat hello.txt
cp hello.txt backup.txt
ls -l
OpenBSD ships with vi; mg is another compact editor available in the base system. To try vi hello.txt, press i to insert, Esc to leave insert mode, then type :wq to save and quit.
Be careful with rm: it deletes immediately, without a recycle bin. Verify your current directory and target names before removing anything.
5 · Ownership and permissions
id
ls -l ~/bsd-practice/hello.txt
stat ~/bsd-practice/hello.txt
umask
Permissions include read, write and execute bits for the owner, group and others. When experimenting on your own file, chmod 600 ~/bsd-practice/hello.txt restricts access to its owner. Do not blindly chmod -R or change ownership of system directories.
6 · Disks, mounted filesystems and usage
df -h
du -sh ~/bsd-practice
mount
sysctl hw.disknames
disklabel sd0 # EXAMPLE: read the partition table ONLY if sd0 is your disk
df -h shows free space, du -sh totals a directory and mount lists active filesystems. sysctl hw.disknames helps discover disk names. Only run disklabel with a real device name after confirming it; the example is a read-only display and does not create or erase partitions.
7 · Packages: pkg_add, pkg_info and pkg_delete
OpenBSD's third-party binary package utilities differ from FreeBSD's pkg tool and Slackware's slackpkg. The following queries are read-only:
pkg_info
pkg_info -Q neomutt
pkg_info -Q irssi
When you are deliberately installing software, switch to root (or use a configured doas):
# ROOT COMMANDS — install chosen packages:
pkg_add neomutt irssi links
# ROOT COMMAND — update installed packages:
pkg_add -u
# ROOT COMMAND — remove a package you no longer want:
# pkg_delete links
The removal example is commented out to prevent accidental deletion when copying. Third-party packages generally place executables under /usr/local/bin.
8 · Patches versus upgrades
| Goal | OpenBSD command | When to use it |
|---|---|---|
| Patch the current release | syspatch | As root: apply supported base-system errata fixes. |
| Update device firmware | fw_update | As root: look for supported missing/updated firmware. |
| Update installed packages | pkg_add -u | As root: update third-party packages. |
| Upgrade to next release | sysupgrade | Major OS release transition; read official upgrade notes and back up first. |
A normal everyday maintenance check need not perform a major release upgrade. You can inspect available base-system patches with syspatch -c, or installed patches with syspatch -l. syspatch is for official release patches; OpenBSD -current snapshots follow a different model.
9 · Networking without Linux iproute2
ifconfig
netstat -rn
ping -c 3 openbsd.org
route -n show
netstat -an -f inet
ifconfig is the usual interface-inspection utility. netstat -rn or route -n show displays routing information. A failed ping does not always prove the connection is broken: some networks block ICMP.
OpenBSD's network settings may use files such as /etc/hostname.em0 or /etc/hostname.igc0, depending on hardware. Never assume your NIC is called em0; look at ifconfig first.
10 · Services with rcctl
rcctl ls on
rcctl check sshd
rcctl get sshd status
These examine service configuration and status. To make a deliberate change you need administrative privileges. For example, enabling SSH on a machine you actually intend to access remotely may involve rcctl enable sshd and rcctl start sshd as root. Do not enable a network-facing service unless you need it and understand its security settings.
Use rcctl rather than editing /etc/rc.conf directly; overrides belong in /etc/rc.conf.local.
11 · Processes, logs and diagnostics
top
ps aux
vmstat 1 5
dmesg | tail -n 25
logger "DarkPC OpenBSD test message"
tail -n 30 /var/log/messages
top displays live processes; press q to quit. ps aux lists processes and vmstat samples memory/CPU activity. dmesg reports boot-time hardware information. logger adds your own benign test message to the system logging service.
Logs can contain private device/network information; redact those details before posting troubleshooting output publicly.
12 · OpenBSD manual pages: your superpower
man intro
man hier
man pkg_add
man rcctl
man ifconfig
man doas.conf
apropos network
OpenBSD's man pages are famous for being comprehensive and clear. Read them freely before trying an unfamiliar command. The online manuals are also searchable on a phone.
13 · Slackware, FreeBSD and OpenBSD command map
| Task | Slackware Linux | FreeBSD | OpenBSD |
|---|---|---|---|
| Find version | cat /etc/slackware-version | freebsd-version | uname -a / sysctl kern.version |
| Inspect network | ip addr | ifconfig | ifconfig |
| List software | ls /var/log/packages | pkg info | pkg_info |
| Add package | installpkg / slackpkg install | pkg install | pkg_add |
| Update installed packages | slackpkg upgrade-all (setup needed) | pkg upgrade | pkg_add -u |
| Services | /etc/rc.d/rc.* | service / sysrc | rcctl |
| Kernel messages | dmesg | dmesg | dmesg |
| Privilege helper | su / sudo (if configured) | su / sudo (if configured) | su / doas (if configured) |
That is the joy of Unix culture: learn the concepts once, then discover each system's own personality.
OpenBSD quick-reference card
# READ-ONLY EXPLORATION
uname -a
id
ls -la
fdisk -v sd0 # only if sd0 is the confirmed disk; read-only
df -h
ifconfig
netstat -rn
pkg_info
man hier
# USE AS ROOT, WHEN APPROPRIATE
# syspatch
# fw_update
# pkg_add -u
For a clean installation walkthrough, read Install OpenBSD 7.9: from USB to first login. For your daily terminal routine, our tmux, NeoMutt and irssi tutorials work nicely alongside OpenBSD.
Official references
DarkPC command reference reviewed 16 October 2026. Examples are educational and have not been run on the visitor's individual hardware.