-
Notifications
You must be signed in to change notification settings - Fork 6
Command Reference
NextBSD's userland is mostly Darwin-derived, so a number of familiar BSD tools
are replaced by their Apple equivalents. Everything below ships on the image, and
each entry names its manual page where one is installed — man launchctl,
man 8 ioreg, and so on.
Standard FreeBSD tools you already know — ps, top, netstat, ifconfig,
vi, pkg — are all still present. This page covers what is different.
launchd is PID 1. It starts, monitors and restarts every system service.
launchctl list # every job launchd knows about
launchctl list com.apple.syslogd # the plist for one job
launchctl load -w /System/Library/LaunchDaemons/com.apple.notifyd.plist
launchctl unload -w /System/Library/LaunchDaemons/com.apple.notifyd.plist-w makes the change persist across reboots by marking the job (dis)abled rather
than only acting on the running system.
See Service Management with launchd for
writing your own job plists. Related pages: launchd(8), launchd.plist(5).
The IOKit registry is in-kernel and exposed at /dev/ioregistry. ioreg walks
it. This is what replaces poking at devinfo or devd state.
ioreg -l # the whole registry tree with properties
ioreg -c PCIDevice # filter by class
ioreg -n hostb0 # find one node by namekextstat # what's loaded
kextload /System/Library/Extensions/Foo.kext
kextunload /System/Library/Extensions/Foo.kext
kldloadand friends are gone on purpose. The build removes thekldload,kldunload,kldstatandkldconfigcommand-line tools to match Darwin's shape. Thekld*(2)syscalls remain, so anything linking against them still works — only the CLI front-ends were retired. If a tutorial tells you to runkldstat, runkextstatinstead.
kextd(8) is the daemon behind these, started by launchd at boot.
NextBSD runs Darwin's syslogd (the Apple System Logger), not FreeBSD's. Logs
are structured records, and syslog is how you query them.
syslog -F bsd # tail the log in familiar BSD text format
syslog -k Sender ipconfigd # only records from one sender
syslog -k Level le err # only errors and worsesyslogd(8) is the daemon; asl.conf(5) and syslog.conf(5) configure it, and
aslmanager(8) handles rotation and expiry. newsyslog(8) is also present.
notifyd is a lightweight named-event bus that Darwin-source daemons use to
signal each other. notifyutil lets you watch and post events by hand, which is
useful when debugging why a daemon is not reacting to something.
notifyutil -w com.apple.system.config.network_change # watch a key
notifyutil -p com.example.my.event # post oneSee notify(3) for the C API and notifyd(8) for the daemon.
Not FreeBSD's ifconfig. Different tool, different arguments; both are on
the system.
ipconfig getifaddr em0 # IP address of one interface
ipconfig ifcount # number of interfacesipconfigd is the daemon: it does DHCPv4, ARP probing and lease renewal, then
publishes results into configd's SCDynamicStore, where other daemons read
them.
Static addressing is on the way. Interfaces are configured by DHCP today. Manual addressing is tracked in nextbsd-userland#58, and the Network preference pane that will expose it — along with DNS and search domains — in nextbsd#396. Both are open; follow them for progress, or say hello in Discussions if you need it sooner.
NextBSD ships Apple's mDNSResponder with its full client API.
dns-sd -B _ssh._tcp # browse for SSH services on the network
dns-sd -R "My Box" _http._tcp . 8080 # register a serviceRelated: mDNSResponder(8), dnsextd(8), nss_mdns.conf(5).
wland(8) owns 802.11 and is started by launchd; wlan is how you talk to it.
wlan list # interfaces wland manages
wlan scan # SSID, BSSID, signal, channel, security
wlan connect Home hunter2hunter2 # join, and remember the network
wlan status # current association
wlan disconnect # leave, and stop autojoiningEvery command takes an optional trailing interface; omit it and wlan uses the
first interface wland owns. Omit the passphrase for an open network.
If wlan status reports associated rather than connected, you have no IP
on purpose — the port is not keyed yet and ipconfigd deliberately holds
DHCP until the 4-way handshake finishes. See
Wireless Networking for that distinction and for
troubleshooting.
nextbsd-version # userland build version, e.g. 20260820-185023
nextbsd-version -k # installed kernel version
nextbsd-version -r # running kernel version (matches uname -r)Every build is stamped with one UTC timestamp shared by the image name,
/etc/os-release and this command, so they always agree. Kernel and userland
come from different repos and different build times, so their stamps differ.
A keyboard-driven text-mode installer. Run it as root from a booted image to lay NextBSD onto a disk — see Installing NextBSD.
Darwin's disk-arbitration daemon. It enumerates storage through FreeBSD's
libgeom, and learns about disks appearing and disappearing by subscribing to
the in-kernel IOKit registry over /dev/ioregistry — the same notification path
ioreg browses, not devd. It runs from launchd; there is no user-facing CLI
for it yet.
A fast filesystem cloner. The installer uses it internally to copy the running system onto the target disk, and it is available for general use.
Darwin's Mach Interface Generator — it turns .defs interface descriptions into
client and server RPC stubs. You need these only if you are writing something
that speaks Mach IPC directly.
| Section | Pages |
|---|---|
| 1 — commands |
launchctl, syslog, notifyutil, dns-sd, cpdup, mig, migcom
|
| 3 — library |
notify, asl, syslog, the dispatch_* family |
| 5 — file formats |
launchd.plist, asl.conf, syslog.conf, newsyslog.conf, nss_mdns.conf
|
| 8 — daemons and admin |
launchd, configd, syslogd, notifyd, mDNSResponder, dnsextd, ioreg, kextd, kextload, kextunload, kextstat, diskarbitrationd, aslmanager, newsyslog, wlan, wland, libnss_mdns
|
man -k <topic> searches all of them.
NextBSD is pre-production — continuous builds only, no stable release yet. Questions are welcome in Discussions.