Skip to content
kazah-png edited this page Jul 11, 2026 · 2 revisions

Shell Commands

NyxOS has 40+ built-in commands in the kernel shell (over serial) and a growing set of ring-3 ELF programs that can be run via exec/spawn or from the userspace shell (/sh.elf).

The userspace shell (/sh.elf, v0.7) features:

  • Line editor: cursors (←/→/Home/End), insert/delete in the middle of a line
  • 16-entry history: ↑/↓ to recall, dedup against the last entry
  • Tab completion: commands (builtins + *.elfs) and filesystem paths (pipeline-aware after |), longest common prefix + candidate listing
  • Pipelines: a | b | c — up to 4 stages wired via pipe() + dup2()
  • I/O redirection: > (truncate), >> (append), < (input from file)
  • Background jobs: cmd & spawns in background, jobs lists them, wait [pid] blocks until done
  • Builtins: cd [dir], pwd, export NAME=value, exit
  • Variable expansion: $VAR from shell-local env, $? for last exit status

See also: Process Management, Networking Stack, Filesystem, GUI Subsystem, Userspace

File operations (kernel builtins)

ls cd pwd cat touch mkdir rm cp mv echo write diff head tail grep sort wc find tree which

Process management (kernel builtins)

exec spawn ps kill jobs wait nice renice mem cpus mtdemo

Network (kernel builtins)

ifconfig dhcp ping setip tcptest tcpserve tcploop tcpdrop

System (kernel builtins)

help clear nyxfetch uname version date uptime reboot crash mount layout hexdump mode cowtest

Entertainment (kernel builtins)

doom beep play sb16play gui fonttest desktop

Ring-3 ELF programs (via exec/spawn or /sh.elf)

Command Description
sh Userspace shell (interactive REPL or sh -c "...")
echo Print argv to stdout (pipeline-friendly)
upper Stdin → uppercase → stdout filter (pipeline test)
cat Concatenate files or stdin to stdout
wc Line/word/byte counts
ls Directory listing
ps Process table snapshot
kill Send signal by pid
top Live process monitor (interactive TUI)
edit Full-screen text editor (interactive TUI)
grep Print lines matching a pattern
head Print first N lines
tail Print last N lines
sort Sort lines alphabetically
find Recursive directory walk
mkdir Create a directory
rm Remove a file
touch Create empty file

Clone this wiki locally