feat: fix ramdisk file copies being incorrectly marked as directories, update man pages
This commit is contained in:
+129
-43
@@ -5,7 +5,8 @@
|
||||
.SH DESCRIPTION
|
||||
The MontaukOS shell is a command interpreter launched by init
|
||||
after system services have started. It provides command
|
||||
execution, file navigation, and command history.
|
||||
execution, file navigation, shell variables, command chaining,
|
||||
tab completion, and command history.
|
||||
|
||||
Commands are either shell builtins or external programs. When
|
||||
a command is not a builtin, the shell searches for a matching
|
||||
@@ -15,10 +16,16 @@
|
||||
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
|
||||
1. <cwd>/<command> (exact name, e.g. "hello.elf")
|
||||
2. <cwd>/<command>.elf
|
||||
3. 0:/os/<command>.elf
|
||||
4. 0:/os/<command> (no extension)
|
||||
5. If on a non-zero drive, the drive root: <drive>:/<command>[.elf]
|
||||
|
||||
A command containing a "/" (or an explicit drive prefix, or a
|
||||
leading "." or "/") is instead treated as a direct path and
|
||||
resolved by the kernel against the process CWD, trying the
|
||||
path as-is and then with ".elf" appended.
|
||||
|
||||
The first match is spawned and the shell waits for it to exit.
|
||||
If no match is found, the shell prints:
|
||||
@@ -26,8 +33,7 @@
|
||||
<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.
|
||||
process.
|
||||
|
||||
.SH BUILTINS
|
||||
|
||||
@@ -36,60 +42,140 @@
|
||||
|
||||
.SS 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.
|
||||
directory. Directory entries are shown with a trailing slash.
|
||||
Examples: ls, ls man, ls os
|
||||
|
||||
.SS 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.
|
||||
Change the working directory. With no argument, returns to the
|
||||
logged-in user's home directory (0:/users/<user>); with /,
|
||||
returns to the drive root. Use cd .. to go up one level.
|
||||
The shell prompt reflects the current directory.
|
||||
Examples: cd os, cd .., cd
|
||||
|
||||
.SS pwd
|
||||
Print the current working directory as an absolute path
|
||||
(e.g. "0:/os").
|
||||
|
||||
.SS echo [-n] ...
|
||||
Print the arguments. -n suppresses the trailing newline.
|
||||
|
||||
.SS set [VAR=value]
|
||||
With no argument, list all shell variables (built-in and
|
||||
user-defined). With VAR=value, set a variable. With a bare
|
||||
name, print that variable's value.
|
||||
|
||||
.SS unset VAR
|
||||
Remove a user-defined shell variable.
|
||||
|
||||
.SS true / false
|
||||
Return exit status 0 / 1 without doing anything. Useful with
|
||||
&& and ||.
|
||||
|
||||
.SS N:
|
||||
A bare "<number>:" (e.g. "1:") switches the current drive to
|
||||
drive N and resets the working directory to that drive's root.
|
||||
|
||||
.SS exit
|
||||
Terminate the shell process.
|
||||
Terminate the shell process (with the last command's exit code).
|
||||
|
||||
.SH SYNTAX
|
||||
.SS Variables
|
||||
NAME=value Set a shell variable (no leading $)
|
||||
$VAR or ${VAR} Expand a variable's value
|
||||
$? Exit status of the last command
|
||||
$USER, $HOME, $PWD Built-in dynamic variables (session user,
|
||||
home directory, current directory)
|
||||
\e$ Escape a literal '$'
|
||||
|
||||
.SS Tilde expansion
|
||||
A leading ~ expands to the session home directory
|
||||
(0:/users/<user>) when followed by end-of-string, '/', or a
|
||||
space.
|
||||
|
||||
.SS Command chaining
|
||||
cmd1 ; cmd2 Run cmd2 unconditionally after cmd1
|
||||
cmd1 && cmd2 Run cmd2 only if cmd1 succeeded (exit 0)
|
||||
cmd1 || cmd2 Run cmd2 only if cmd1 failed (nonzero exit)
|
||||
|
||||
Single and double quotes protect ;, &&, and || from being
|
||||
treated as separators.
|
||||
|
||||
.SS Comments
|
||||
A '#' outside of quotes starts a comment; the rest of the line
|
||||
is ignored.
|
||||
|
||||
.SH EXTERNAL COMMANDS
|
||||
All external commands live in 0:/os/ (see COMMAND RESOLUTION).
|
||||
Where a dedicated man page exists it is noted below; run
|
||||
'man <command>' for details.
|
||||
|
||||
.SS 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
|
||||
fontscale [n] Get or set terminal font scale
|
||||
reset Reboot the system
|
||||
shutdown Shut down the system
|
||||
.SS File commands
|
||||
cat <file> Display file contents
|
||||
edit [file] Text editor -- see edit(1)
|
||||
copy <src> <dst> Copy a file
|
||||
move <src> <dst> Move/rename a file
|
||||
rm <file> Remove a file
|
||||
touch <file> Create an empty file
|
||||
|
||||
.SS Network commands (0:/os/)
|
||||
ping <host> Send ICMP echo requests
|
||||
nslookup <host> DNS lookup
|
||||
ifconfig Show/set network configuration
|
||||
.SS System commands
|
||||
man <topic> View manual pages -- see man(1)
|
||||
whoami Print the current username
|
||||
info / mtkfetch Show system information
|
||||
date Show current date and time
|
||||
uptime Show system uptime
|
||||
proclist List running processes
|
||||
power CPU power/thermal status (power [watch [secs]])
|
||||
clear Clear the screen and framebuffer
|
||||
fontscale [n] Get or set terminal font scale -- see fontscale(1)
|
||||
lua Lua interpreter
|
||||
tcc TinyCC (in-system C compiler)
|
||||
reset Reboot the system
|
||||
shutdown Shut down the system
|
||||
|
||||
.SS Network commands
|
||||
ping <host> Send ICMP echo requests -- see ping(1)
|
||||
nslookup <host> DNS lookup -- see nslookup(1)
|
||||
ifconfig Show/set network configuration
|
||||
tcpconnect <host> <port> Interactive TCP client
|
||||
irc IRC client
|
||||
dhcp DHCP client
|
||||
fetch HTTP/HTTPS client (TLS 1.2)
|
||||
wiki Wikipedia article viewer
|
||||
httpd HTTP server
|
||||
irc IRC client
|
||||
dhcp DHCP client -- see dhcp(1)
|
||||
fetch <url> HTTP/HTTPS client (TLS 1.2) -- see fetch(1)
|
||||
wiki <title> Wikipedia article viewer -- see wiki(1)
|
||||
httpd HTTP server
|
||||
|
||||
Network commands accept both IP addresses and hostnames.
|
||||
Hostnames are resolved via the configured DNS server.
|
||||
|
||||
.SS Games (0:/games/)
|
||||
doom DOOM
|
||||
.SS Bluetooth
|
||||
btlist List connected Bluetooth devices
|
||||
btbonds List bonded (paired) Bluetooth devices
|
||||
|
||||
.SS Software-defined radio
|
||||
sdr [freqMHz [rateHz]] Receive and report basic signal
|
||||
statistics from an attached RTL-SDR dongle
|
||||
|
||||
GUI applications (window server programs, not run from the
|
||||
shell prompt as text commands) live under 0:/apps/, one bundle
|
||||
per app -- e.g. doom, terminal, texteditor, spreadsheet,
|
||||
wordprocessor, paint, calculator, network, bluetooth, audio,
|
||||
disks, devexplorer, procmgr, powermgr, printers, timezone,
|
||||
weather, wikipedia. There is no 0:/games/ directory.
|
||||
|
||||
.SH TAB COMPLETION
|
||||
Pressing Tab completes the word under the cursor against, in
|
||||
order: executable names in 0:/os/, shell builtins, and file/
|
||||
directory entries in the current directory. A single match is
|
||||
completed inline; multiple matches are listed below the prompt.
|
||||
|
||||
.SH INPUT
|
||||
The shell uses non-blocking keyboard input via SYS_GETKEY to
|
||||
support arrow key detection. Lines are limited to 255
|
||||
characters.
|
||||
The shell uses non-blocking keyboard input via SYS_GETKEY (with
|
||||
SYS_INPUT_WAIT to sleep between events) to support arrow key
|
||||
detection. Lines are limited to 255 characters.
|
||||
|
||||
.SS Editing
|
||||
Backspace Delete character before cursor
|
||||
Enter Execute command
|
||||
Tab Tab-complete the current word
|
||||
Enter Execute the command line
|
||||
|
||||
.SS History
|
||||
The shell stores the last 32 unique commands. Duplicate
|
||||
@@ -99,11 +185,11 @@
|
||||
Down Arrow Recall next command (or clear line)
|
||||
|
||||
.SH PROMPT
|
||||
The prompt displays the current working directory:
|
||||
The prompt displays the current drive and working directory:
|
||||
|
||||
0:/> _ (at root)
|
||||
0:/> _ (at root of drive 0)
|
||||
0:/os> _ (in os/ directory)
|
||||
0:/man> _ (in man/ directory)
|
||||
1:/> _ (at root of drive 1)
|
||||
|
||||
.SH SEE ALSO
|
||||
man(1), intro(1), syscalls(2)
|
||||
|
||||
Reference in New Issue
Block a user