Commands
Motor OS boots into rush, a POSIX-style shell.
PATH is /system/bin:/user/bin, plus /devtools/bin on
the developer image. ls /system/bin and ls /user/bin list what is
installed.
sysbox
Most everyday commands are calls into /system/bin/sysbox, which was inspired
by busybox in Linux.
Motor OS has no symbolic links, so each command is a two-line rush script of the
same name in /system/bin that forwards to sysbox; sysbox help lists
them.
| Command | What it does |
|---|---|
cat, less, wc | Print, page, and count files. less is a full pager built on the crossterm port. |
head [-n [-]NUM | -c [-]NUM] [-q | -v] [-z] [FILE]... | The first 10 lines of each file, or the first NUM lines or bytes; a leading - on NUM prints all but the last NUM. With several files, each gets a ==> NAME <== header. Options follow GNU head. |
tail [-n [+]NUM | -c [+]NUM] [-q | -v] [-z] [FILE]... | The last 10 lines of each file, or the last NUM lines or bytes; a leading + on NUM starts at line or byte NUM instead. Options follow GNU tail, except that following a growing file (-f, -F) is not supported. |
diff [-u | -U NUM | -c | -C NUM] [-q] [-s] [-r] [-N] [-i] [-b] [-w] FILE1 FILE2 | Compare files, or directories, line by line. Output formats, messages, exit status (0 same, 1 different, 2 trouble), and the hunks themselves follow GNU diff. Side-by-side and ed output, -B, -I, and -x are not supported. |
ls, find | List and search directories. |
cp, mv, rm, mkdir, rmdir | Copy (preserving permissions), move, and delete files and directories. A denied operation fails with a nonzero status. |
chmod MODE PATH... | Set permissions; MODE is nine characters in System, Interactive, None order (see Filesystem). |
ps, pstat, top, free, uptime, stats | Processes (with role markers * System and + Interactive), CPU usage, memory, and any metric (see Logs and diagnostics). |
ss | TCP sockets known to sys-io. |
ping [-c COUNT] [-i SECONDS] [-W SECONDS] [-s BYTES] DESTINATION | ICMP echo to an IPv4 or IPv6 address, localhost, or a DNS name. |
date, time, sleep | The current time, timing a command, and pausing. |
printenv | The environment. |
loop | Run a command repeatedly. |
A few names in /system/bin are scripts without a sysbox applet behind
them: df (over stats), uname (prints "Motor OS"),
sh (forwards to rush, so C library system() and
popen() work), and exit (so that ssh host exit 5,
which looks for an executable, works). kill, cd,
history, clear, and the other shell builtins are part of rush.
rg is ripgrep, a real binary, on the standard and developer images.
Programs
| Program | Where | What it is |
|---|---|---|
| rush | /system/bin | The shell, on the console and over SSH. |
| rmux | /user/bin | A tmux-like terminal multiplexer with detachable sessions. |
| red | /user/bin | A vi-like editor with syntax highlighting. |
| kibim | /user/bin | A small kilo-style editor; standard and developer images. |
| httpd | /user/bin | A small static-file HTTP server with optional TLS: httpd -a ADDR:PORT -d DIR [--ssl-cert PEM --ssl-key PEM]. |
| httpd-axum | /user/bin | The same job on axum, tower-http, and Tokio, with TLS through rustls. Serves this website. |
| russhd | /system/services | The SSH server; started by sys-init (see Running Motor OS). |
| curl | /system/bin | Developer image: a small curl-compatible HTTPS client written in Rust, used by Lorry to fetch crates and by gix for Git transfers. |
| gix | /devtools/bin | Developer image: a small Git client with init, clone and fetch over HTTPS or SSH, status, log, diff, add, unstage, restore, commit, branch, tag, remote, switch, checkout, merge, recover, and push of one branch or tag over SSH. See the gix page. |
| lua | /devtools/bin | Developer image: Lua 5.4, built natively against the C library. |
| sed | /devtools/bin | Developer image: the stream editor, uutils sed (GNU-compatible, in Rust). sed -i edits a file in place: the file keeps its permissions, and so must be writable. |
The developer image adds gix, Lorry, Gears, mdbg, the native compilers, and the test suites; see Developer image.
Configuration files
| File | Used by |
|---|---|
/system/cfg/sys-init.cfg | sys-init: the console program and role, strobe, and the services with their capability masks. |
/system/cfg/sys-net.toml | sys-io: network devices, addresses, routes, DNS servers, and limits. |
/system/cfg/sshd.toml | russhd: listen address, host key, users, passwords, and authorized keys. |
/system/cfg/sys-tty.cfg, /system/cfg/rush.cfg | The console shell's environment and startup file. |
/system/cfg/libc/hosts, resolv.conf | The DNS resolver and the C library. resolv.conf is written by sys-io. |
/user/cfg/red.toml, rmux.toml, kibim/, gears.toml, lorry/ | Per-program settings, all optional. |