SHELL(1)

NAME
    shell - ZenithOS interactive command shell

DESCRIPTION
    The ZenithOS shell is a command interpreter launched by init
    after system services have started. It provides command
    execution, file navigation, and command history.
    Commands are either shell builtins or external programs. When
    a command is not a builtin, the shell searches for a matching
    ELF binary and executes it as a child process.

COMMAND RESOLUTION
    When a non-builtin command is entered, the shell searches for
    a matching binary in the following order:
        1. 0:/os/<command>.elf
        2. 0:/games/<command>.elf
        3. 0:/<cwd>/<command>.elf (if cwd is set)
        4. 0:/<command>.elf
    The first match is spawned and the shell waits for it to exit.
    If no match is found, the shell prints:
        <command>: command not found
    Arguments after the command name are passed to the spawned
    process. File path arguments are resolved against the current
    working directory before being passed to external programs.

BUILTINS

  help
    Display a categorized list of available commands.

  ls [dir]
    List files in the current directory, or in the specified
    directory. When a directory argument is given, the output
    shows only the entries inside that directory with the
    directory prefix stripped. Directory entries are shown
    with a trailing slash.
    Examples: ls, ls man, ls os

  cd [dir]
    Change the working directory. With no argument or with /,
    returns to the root (0:/). Use cd .. to go up one level.
    Trailing slashes on directory names are stripped.
    The shell prompt reflects the current directory.
    Examples: cd os, cd .., cd

  exit
    Terminate the shell process.

EXTERNAL COMMANDS

  System commands (0:/os/)
    man <topic> View manual pages
    cat <file> Display file contents
    info Show system information
    date Show current date and time
    uptime Show system uptime
    clear Clear the screen and framebuffer
    reset Reboot the system
    shutdown Shut down the system

  Network commands (0:/os/)
    ping <ip> Send ICMP echo requests
    ifconfig Show/set network configuration
    tcpconnect <ip> <port> Interactive TCP client
    irc IRC client
    dhcp DHCP client
    fetch HTTP client
    httpd HTTP server

  Games (0:/games/)
    doom DOOM

INPUT
    The shell uses non-blocking keyboard input via SYS_GETKEY to
    support arrow key detection. Lines are limited to 255
    characters.

  Editing
    Backspace Delete character before cursor
    Enter Execute command

  History
    The shell stores the last 32 unique commands. Duplicate
    consecutive entries are suppressed.
    Up Arrow Recall previous command
    Down Arrow Recall next command (or clear line)

PROMPT
    The prompt displays the current working directory:
        0:/> _ (at root)
        0:/os> _ (in os/ directory)
        0:/man> _ (in man/ directory)

SEE ALSO
    man(1), intro(1), syscalls(2)