Repository navigation
Shell Basics EN
Language: English | Shell-Basics
The oc> shell is a Unix-flavoured command line - with pipes,
redirection, background jobs, environment variables, aliases and a
small scripting language. This page walks the real feature set.
- History: up/down arrows walk previous lines.
- Editing within the line;
Ctrl+Ukills the line. - Input sources: PS/2 keyboard and COM1 serial feed the same queue -
with
-serial mon:stdioin QEMU you type over serial.
oc> dhcp && ping 10.0.2.2 (run ping only if dhcp succeeded)
oc> cat a.txt ; cat b.txt (sequence regardless)
oc> health || dmesg (second only if first failed)
oc> ping 10.0.2.2 & (background job)
oc> g6_test & (long test in the background)
oc> ls | grep log (pipe stdout of ls into grep)
oc> cat /mnt/f.txt > /tmp/g.txt (write stdout to a file)
oc> cat /mnt/f.txt >> /tmp/g.txt (append)
oc> wget 10.0.2.2 < in.txt (stdin from a file)
* and ? expand in the shell before the command runs:
oc> ls /mnt/*.txt
oc> cat /mnt/report?.txt
oc> export NAME=value (set)
oc> echo $NAME (use - $VAR expands in the line)
oc> env (list all)
Environment storage limits: 32 variables, names up to 32 bytes,
values up to 256 bytes (shell/shell.h).
oc> alias ll ls -l
oc> ll
oc> unalias ll
Alias values may hold full pipelines - up to 512 bytes stored in full or refused (never silently truncated). 32 alias slots.
oc> cd /mnt
oc> pwd
A script is a text file of command lines; feed it with the shell's
script runner (see help -a for the exact command name in your
build). The editor command gives you an in-guest full-screen text
editor to write those scripts.
oc> help (short list, one line per command)
oc> help -a (all 233 commands, alphabetical, with descriptions)
oc> help -w (the same commands grouped by the work package
that introduced them)
The complete indexed reference with one page per command is Command-Reference-EN.
Commands may be added across versions, never removed; names and overall behaviour of shipped commands are stable (see Contributing-EN). The command table capacity is 256 with 233 registered at present.