# rfsh Command Reference (Complete Subcommand and Help Manual for AI Agents)

> This document is a machine-readable reference for all `rfsh` subcommands. **The help bodies are verbatim program output**, with redaction only:
> Version strings, build dates, copyright/vendor banners, local drive-letter paths, sample hostnames, and user directories have been replaced with neutral placeholders.
> Command semantics, options, arguments, and example structure are unchanged.
> 
> Capture method: `rfsh -a` (applet list) + `rfsh help` (built-in command list) + per-command `-h` / `--help` / no-argument live runs.
> When a command has multiple help triggers, the one with a usage block, no parser error lines, and the most complete content is used.
> See §8 for generation and update procedures; redaction rules are also in §8 — run the checker before publishing.

## Table of Contents

| Section | Contents |
|---|---|
| §1 | Invocation forms, exit codes, path semantics, verbatim top-level help |
| §2 | Overview table of all applets (grouped by function) |
| §3 | Built-in commands (shell layer, not in the `-a` list) |
| §4 | Verbatim per-command help output |
| §5 | Field-tested notes and pitfalls for AI agents |
| §6 | Copy-paste-ready command templates |
| §7 | Symbol index (no paths) |
| §8 | Generation/update procedures, redaction rules, pre-publish checklist |

**Scope**: 49 applets + 16 built-in commands; 1149 lines of verbatim help output; 1 command (`grep`) whose usage cannot be obtained at runtime.

## 1. Invocation Forms and General Conventions

```text
rfsh [opt] [arguments] ...
rfsh <applet> [applet-options] [args] ...
rfsh -e "cmd;..."        # execute a string of commands (remaining command-line args are appended to -e)
rfsh -f <file>           # execute from a file ('-' means stdin)
rfsh -a                  # list all applets (authoritative source for §2)
```

Verbatim top-level help (redacted):

```text
rfsh-windows-x64 v<version> - RANFS Shell Tool
Usage: rfsh [opt] [arguments] ...
	-e ["cmd;..."] execute string 'cmd'. Everything left on the
		   command line is appended to it, so
		   'rfsh -e ls -a /dir' runs 'ls -a /dir' unquoted
	-f [file]  execute commands from local file ('-' = stdin pipe)
	-c [config_file]  set config file
	-s [list|key=val] Set configuration options
	-E List the environment variables the program honours
	-a List all available commands
	-i Install .lua file association (double-click runs 'rfsh lua <file>')
	-u Uninstall .lua file association
	-o [log_file]     set output log file
	-l [log_level] set log level: verb, dbg, info, warn, err
	-v show version
	-h display this help
```

- **`-a` is the single source of truth for the command list**: after adding or removing an applet, re-run the capture instead of hand-editing the command table.
- **Path semantics**: local paths, `///<host>/...` remote paths, and URLs supported by file drivers may be mixed within a single command; remote paths may still contain a drive letter (e.g. `///<host>/<drive>:/...`). The `remote-host-a` / `remote-host-b` / `local-host` names below are redacted placeholder hostnames.
- **Exit codes**: 0 means success; 1/2 usually indicate argument or usage errors. Note that some applets still return 1 when printing usage, so do not judge whether help was obtained by exit code alone.
- **`-E`**: list the environment variables the program supports; **`-s key=val` / `-s list`**: override or list configuration options; **`-c <file>`**: specify a config file; **`-v`**: version; **`-h`**: this top-level help.
- **`--help` is not universal**: this is the most common pitfall found in testing; see §5.1.

## 2. Overview of All Applets

Description columns are verbatim from `rfsh -a`; "Help trigger" is the method actually chosen during this capture.

### 2.1 Text Viewing and Line Processing

View, filter, count, and convert by line or by byte; UTF-8 / UTF-16LE / UTF-16BE BOMs are detected uniformly when reading text.

| Command | Description | Help trigger | Lines |
|---|---|---|---|
| `cat` | Concatenate and display files | `--help` | 19 |
| `od` | Dump files in octal and other formats | `--help` | 21 |
| `hexdump` | Dump files in hex format | `--help` | 27 |
| `head` | Print the first lines of files | `--help` | 15 |
| `tail` | Print the last lines of files | `--help` | 15 |
| `cut` | Select parts of each line | `--help` | 21 |
| `sort` | Sort lines of text files | `--help` | 38 |
| `uniq` | Report or omit repeated lines | `--help` | 19 |
| `wc` | Count lines, words and bytes | `--help` | 19 |
| `sed` | Stream editor for filtering and transforming text | `--help` | 27 |
| `tr` | Translate or delete characters | `--help` | 17 |
| `awk` | Pattern scanning and processing language | `--help` | 20 |

### 2.2 Verification, Splitting, and Comparison

Byte-wise comparison, digests and manifest checks, splitting by size or line count — all byte-exact.

| Command | Description | Help trigger | Lines |
|---|---|---|---|
| `cmp` | Compare two files byte by byte, either side remote | `--help` | 19 |
| `md5sum` | Print or check MD5 digests | `--help` | 19 |
| `split` | Split a file into pieces | `--help` | 15 |

### 2.3 File and Directory Operations

Unified local/remote path semantics; chmod only takes effect on POSIX endpoints.

| Command | Description | Help trigger | Lines |
|---|---|---|---|
| `ls` | List directory contents | `--help` | 19 |
| `cp` | Copy files and directories | `--help` | 24 |
| `rm` | Remove files and directories | `--help` | 26 |
| `mv` | Move (rename) files | `--help` | 18 |
| `rmdir` | Remove empty directories | `--help` | 18 |
| `ln` | Create hard and symbolic links | `--help` | 17 |
| `link` | Create a hard link | `--help` | 7 |
| `mkdir` | Create directories | `--help` | 13 |
| `stat` | Show file metadata | `--help` | 19 |
| `touch` | Change file timestamps | `--help` | 15 |
| `chmod` | Change permission bits (posix endpoints) | `--help` | 24 |
| `df` | Show volume capacity | `--help` | 13 |
| `find` | Search a local or a remote tree | `-h` | 31 |
| `grep` | Search for patterns in files | `source fallback` | 45 |

### 2.4 Time and Scheduling

Clock sync, NTP server, scheduled tasks; ntpdate requires an explicit server.

| Command | Description | Help trigger | Lines |
|---|---|---|---|
| `ntpdate` | Set the system time from an NTP server | `-h` | 27 |
| `ntpd` | NTP server: hand our clock out to clients | `-h` | 23 |
| `crond` | Unix scheduler for automating tasks | `-h` | 26 |

### 2.5 Services and Remote Access

Mostly resident daemons. Always pass -h/--help with a timeout when capturing help; never run them without arguments.

| Command | Description | Help trigger | Lines |
|---|---|---|---|
| `telnetd` | simpe telnetd | `--help` | 19 |
| `httpd` | simple httpd | `-h` | 11 |
| `rftd` | ftpd server | `-h` | 19 |
| `rfbd` | nbd server | `-h` | 16 |
| `rfsd` | rfsd server | `-h` | 18 |
| `rcli` | remote client tool | `-h` | 15 |
| `rsh` | rsh shell | `--help` | 79 |
| `rcp` | rcp fast copy file | `--help` | 84 |
| `rdd` | rdd power dd | `--help` | 86 |

### 2.6 Runtimes and Utilities

Specialized tools: 7z decoding, firmware/RAID/SQLite/HTTP/eBPF/WASM/Lua, and more.

| Command | Description | Help trigger | Lines |
|---|---|---|---|
| `m7z` | 7z compress and decompress | `(no args)` | 9 |
| `rfue` | rfue tool | `-h` | 16 |
| `raid` | raid tool | `--help` | 5 |
| `sqlite` | sqlite tool | `--help` | 44 |
| `curl` | curl tool | `--help` | 17 |
| `ubpf` | simpe ubpf | `--help` | 17 |
| `wasm3` | simpe wasm3 | `--help` | 7 |
| `lua` | lua shell | `--help` | 11 |

## 3. Built-in Commands (Shell Layer)

These commands are listed by `rfsh help` and **do not appear in `rfsh -a`**. Descriptions are verbatim from `rfsh help`.

| Command | Description |
|---|---|
| `show` | Show the status of the program |
| `set` | Set public options |
| `call` | call application commands |
| `pwd` | Print working directory |
| `alias` | Define or display alias |
| `unalias` | Delete the alias set by alias |
| `unset` | Cancel environment variable |
| `echo` | Echo the STRING(s) to output |
| `env` | Display all variables |
| `source` | Exec commands from file |
| `run` | Execute a shell command with libsh builtin support |
| `pipe_run` | Execute a shell pipeline using libsh commands |
| `exit` | Exit the service program |
| `quit` | Quit the current session |
| `help` | Display this text |
| `?` | Synonym for `help' |

**Important**: the actual behavior of `help <cmd>` is to execute `<cmd> -h`, not to print dedicated help text. Observed consequences:

- `help env` dumps **all environment variables** (possibly including credentials, user directories, and internal addresses), so this document includes no raw output from built-in commands; the public document keeps only the one-line descriptions in the table above.
- `help exit` / `help quit` end the session immediately; `help show` reports "variable does not exist"; only a few commands such as `help set` / `help alias` print their own option descriptions.
- To script the retrieval of built-in command information, prefer `rfsh help` (the list) plus `rfsh help <safe-command-name>`, and apply an allowlist filter to the output.

## 4. Verbatim Per-Command Help Output

The `text` block in each section is verbatim program output (redacted only). The invocation form is uniformly `rfsh <command> <trigger>`.

### 4.1 Text Viewing and Line Processing

#### `cat`

> Concatenate and display files
> 
> Group: Text Viewing and Line Processing · Help trigger: `--help` · Capture exit code: 0 · 19 lines

```text
Usage: cat [-u] [-n] [-b] [-s] [-vteA] [file ...]

Copy each file to the standard output.  A file may be local
("some/dir/a.txt"), a remote url ("///remote-host-a/var/log/messages") or
anything else a file driver serves (http, ...).  "-" is stdin.

Options:
  -u      ignored (unbuffered, kept for compatibility)
  -n      number all output lines
  -b      number non-empty output lines, overrides -n
  -s      squeeze repeated empty lines into one
  -v      show non-printing characters as ^X and M-X
  -e      ...and mark the end of every line with $
  -t      ...and show tabs as ^I
  -A      same as -vte

Examples:
  cat ///remote-host-a/etc/passwd
  cat -n some/dir/a.txt ///remote-host-b/some/dir/b.txt
```

#### `od`

> Dump files in octal and other formats
> 
> Group: Text Viewing and Line Processing · Help trigger: `--help` · Capture exit code: 0 · 21 lines

```text
Usage: od [-A radix] [-j skip] [-N count] [-t type] [-v] [file ...]
       od [-a] [-b] [-c] [-d] [-f] [-h] [-i] [-l] [-o] [-s] [-x] [file ...]

Dump a file as numbers.  The file may be local, an endpoint url or
anything else a file driver serves (http, ...); "-" is stdin.
Files on one command line are read as one stream.

Options:
  -A R   address radix: d, o, x, or n (no address)
  -j N   skip N bytes first
  -N N   dump at most N bytes
  -t T   type: a, c, d[SIZE], f[SIZE], o[SIZE], u[SIZE], x[SIZE],
         where SIZE is 1, 2, 4 or 8; may be repeated or comma separated
         a trailing z adds the printable column, as in x1z
  -v     do not fold duplicate lines into "*"

Default: -A o -t o2

Examples:
  od -A x -t x1 ///remote-host-a/dev/urandom
  od -c -N 64 some/dir/a.bin
```

#### `hexdump`

> Dump files in hex format
> 
> Group: Text Viewing and Line Processing · Help trigger: `--help` · Capture exit code: 0 · 27 lines

```text
Usage: hexdump [-bCcdo x] [-n N] [-s N] [-v] [-e FMT] [file]

Dump a file in hex, octal, decimal or characters.  The file may be
local, an endpoint url or anything else a file driver serves (http,
...); "-" is stdin.

Options:
  -b       one line of octal bytes
  -c       one line of characters
  -C       canonical hex and ascii, 16 bytes a line
  -d       unsigned decimal shorts
  -o       octal shorts
  -x       hexadecimal shorts (the default)
  -n N     dump only N bytes
  -s N     skip N bytes first
  -v       do not fold duplicate lines into "*"
  -e FMT   use a format string instead of the above
  -f FILE  take one format string per line of FILE

A format unit is COUNT[/SIZE] "printf", one conversion per unit:
  %%_a %%_A (offset, may end in d o x), %%_p (printable), %%_c (char),
  %%_u (named char), and the printf ones (d i o u x X e f g c).

Examples:
  hexdump -C ///remote-host-a/dev/urandom
  hexdump -n 64 -s 1024 some/dir/a.bin
  hexdump -e '"%08.8_ax  " 8/1 "%02x " "\n"' some/dir/a.bin
```

#### `head`

> Print the first lines of files
> 
> Group: Text Viewing and Line Processing · Help trigger: `--help` · Capture exit code: 0 · 15 lines

```text
Usage: head [-n lines | -c bytes] path ...

Print the first lines/bytes of each file.  A path may be local
("some/dir/a.log"), a remote url ("///remote-host-a/var/log/messages")
or anything else a file driver serves (http, ...).

Options:
  -n N   print N lines (default 10); -N means the same thing
  -n +N   print from line N to the end (tail only)
  -c N   print N bytes; -c +N prints from byte N to the end

Examples:
  head -n 20 ///remote-host-a/var/log/messages
  head -5 some/dir/a.log
  head -c 1k some/dir/a.bin
```

#### `tail`

> Print the last lines of files
> 
> Group: Text Viewing and Line Processing · Help trigger: `--help` · Capture exit code: 0 · 15 lines

```text
Usage: tail [-n lines | -c bytes] path ...

Print the last lines/bytes of each file.  A path may be local
("some/dir/a.log"), a remote url ("///remote-host-a/var/log/messages")
or anything else a file driver serves (http, ...).

Options:
  -n N   print N lines (default 10); -N means the same thing
  -n +N   print from line N to the end (tail only)
  -c N   print N bytes; -c +N prints from byte N to the end

Examples:
  tail -n 20 ///remote-host-a/var/log/messages
  tail -5 some/dir/a.log
  tail -c 1k some/dir/a.bin
```

#### `cut`

> Select parts of each line
> 
> Group: Text Viewing and Line Processing · Help trigger: `--help` · Capture exit code: 0 · 21 lines

```text
Usage: cut -b list | -c list | -f list [-d char] [-s] [file ...]
       cut -b list | -c list | -f list [--complement] [--output-delimiter=str] [file ...]

Print the selected part of each line.  A file may be local, an
endpoint url or anything else a file driver serves (http, ...);
"-" is stdin.

Options:
  -b LIST   select bytes (same as -c here: no multibyte decoding)
  -c LIST   select characters
  -f LIST   select fields
  -d CHAR   field delimiter (default TAB)
  -s        with -f: drop lines that hold no delimiter
  --complement        print everything the list does not select
  --output-delimiter=STR  join the pieces with STR

LIST is N, N-, N-M or -M, comma separated, e.g. 1,3-5,9-

Examples:
  cut -f 2 ///remote-host-a/etc/passwd
  cut -d, -f 1,3-5 some/dir/a.csv
```

#### `sort`

> Sort lines of text files
> 
> Group: Text Viewing and Line Processing · Help trigger: `--help` · Capture exit code: 0 · 38 lines

```text
Usage: sort [-bCcfghinrsu] [-k key] [-t sep] [-o out] [--algo name] [file ...]

Sort lines.  A file may be local, an endpoint url or anything else a
file driver serves (http, ...); "-" is stdin.  -o may point at an
endpoint too.

Options:
  -k F[.C][,F[.C]][mods]  sort key: field, character, and modifiers
                          b d f g h i M n r, e.g. -k3,3n
  -t SEP   field separator (default: runs of blanks)
  -b       ignore leading blanks
  -d       dictionary order
  -f       fold case
  -g       general numeric
  -h       human numeric (K, M, G, T, P)
  -i       ignore non printing characters
  -M       month name order
  -n       numeric
  -r       reverse
  -s       stable: never compare the whole line as a last resort
  -u       output only the first of a run of equal lines
  -z       lines end with NUL instead of newline
  -c       check whether the input is sorted
  -C       like -c but silent
  -o FILE  write the result to FILE
  -A NAME  sorting engine (also RF_SORT_ALGO in the environment):
             merge   stable bottom-up merge, the default
             os      the C library's qsort_r
             simple  pal's own quicksort
             glibc   glibc's quicksort
             tim     timsort, best on already sorted runs

The whole input is held in memory.

Examples:
  sort -t: -k3,3n ///remote-host-a/etc/passwd
  sort -u -o ///remote-host-a/tmp/s.txt some/dir/a.txt
  sort --algo=tim -k1,1n some/dir/big.log
```

#### `uniq`

> Report or omit repeated lines
> 
> Group: Text Viewing and Line Processing · Help trigger: `--help` · Capture exit code: 0 · 19 lines

```text
Usage: uniq [-c|-d|-D|-u] [-f N] [-s N] [-w N] [input [output]]

Report or drop repeated adjacent lines.  input and output may each be
a local path, an endpoint url or anything else a file driver serves
(http, ...).  With no input the standard input is read, with no
output the standard output is written.

Options:
  -c      prefix every line with its repeat count
  -d      print only lines that repeat
  -D      print every line of a group that repeats
  -u      print only lines that do not repeat
  -f N    skip N leading fields when comparing
  -s N    skip N characters when comparing
  -w N    compare at most N characters

Examples:
  uniq -c ///remote-host-a/var/log/messages
  uniq -d some/dir/a.txt ///remote-host-a/tmp/dups.txt
```

#### `wc`

> Count lines, words and bytes
> 
> Group: Text Viewing and Line Processing · Help trigger: `--help` · Capture exit code: 0 · 19 lines

```text
Usage: wc [-lwc] [-m] path ...

Count lines, words, bytes and characters.  A path may be
local ("some/dir/a.txt"), a remote url ("///remote-host-a/etc/passwd")
or anything else a file driver serves (http, ...).

Options:
  -l   lines only
  -w   words only
  -c   bytes only
  -m   characters (multibyte aware) only

With no option all three (lines, words, bytes) are printed,
always in the order lines, words, bytes.

Examples:
  wc ///remote-host-a/etc/passwd
  wc -l some/dir/a.txt ///remote-host-b/some/dir/b.txt
  wc -m some/dir/utf8.txt
```

#### `sed`

> Stream editor for filtering and transforming text
> 
> Group: Text Viewing and Line Processing · Help trigger: `--help` · Capture exit code: 0 · 27 lines

```text
Usage: sed [-n] [-r|-E] [-i[SUFFIX]] {-e SCRIPT | -f FILE} [file ...]
       sed [-n] [-r|-E] [-i[SUFFIX]] SCRIPT [file ...]

Stream editor.  The input may be a local path, an endpoint url or
anything else a file driver serves (http, ...); "-" is stdin.

Options:
  -n            only print lines told to (p command, s///p flag)
  -e SCRIPT     add SCRIPT to the commands (repeatable)
  -f FILE       add the commands in FILE
  -r, -E        extended regular expressions
  -i[SUFFIX]    edit files in place (original kept as FILE.SUFFIX)

Commands (each may take an address N, /re/, $, or a range N,M):
  s/re/repl/    substitute; repl uses & and \1..\9
  d p P n N     delete / print / print-first / next / append-next
  a\ i\ c\     append / insert / change text
  y/s/d/        transliterate
  h H g G x     hold space and pattern space
  : b t T       label / branch / branch-on-subst / -on-not
  = q           line number / quit
  w FILE r FILE write / read

Examples:
  sed 's/foo/bar/' ///remote-host-a/etc/fstab
  sed -n '/error/p' some/dir/log.txt
  sed 's/\r$//' ///remote-host-a/tmp/win.txt
```

#### `tr`

> Translate or delete characters
> 
> Group: Text Viewing and Line Processing · Help trigger: `--help` · Capture exit code: 0 · 17 lines

```text
Usage: tr [-c] [-d] [-s] set1 [set2] [file]

Translate or delete characters read from a file.  The file may be
local, an endpoint url or anything else a file driver serves (http,
...); with no file operand tr reads stdin.

Options:
  -c   use the complement of set1
  -d   delete the characters in set1 instead of translating
  -s   squeeze runs of repeated characters

A set is made of characters, a-z ranges, \ \ooo escapes, [:class:],
 [=c=] and [c*n].

Examples:
  tr a-z A-Z < some/dir/a.txt
  tr -d '\r' ///remote-host-a/etc/fstab
```

#### `awk`

> Pattern scanning and processing language
> 
> Group: Text Viewing and Line Processing · Help trigger: `--help` · Capture exit code: 0 · 20 lines

```text
Usage: awk [-F sep] [-v var=val] [-f progfile | 'program'] [file ...]

Pattern scanning and processing language.  The input may be a local
path, an endpoint url or anything else a file driver serves (http,
...); "-" is stdin.

Options:
  -F sep        set the field separator
  -v var=val    assign a variable before the program runs
  -f progfile   read the program from progfile

Built-ins: print printf length substr index split sub gsub int
           sqrt exp log sin cos rand srand tolower toupper
Variables: $0..$N NF NR FNR FS OFS ORS RS
Patterns:  BEGIN END /regex/ and boolean/relational expressions

Examples:
  awk '{print $1}' ///remote-host-a/etc/passwd
  awk -F: '{print $1, $3}' some/dir/users.txt
  awk '{s+=$1} END{print s}' nums.txt
```

### 4.2 Verification, Splitting, and Comparison

#### `cmp`

> Compare two files byte by byte, either side remote
> 
> Group: Verification, Splitting, and Comparison · Help trigger: `--help` · Capture exit code: 0 · 19 lines

```text
Usage: cmp [-slb] file1 file2

Compare two files byte by byte.  Either file may be local
("some/dir/a.bin"), a remote url ("///remote-host-a/tmp/a.bin") or any
other url a driver serves, in any combination: comparing one
endpoint's copy against another's is the point of having this
here.

Options:
  -s   quiet: print nothing, only set the exit status
  -l   list every differing byte (offset, then both values)
  -b   print the octal value of the first differing byte

Exit status is 0 when the files are identical, 1 when they
differ, 2 when one of them cannot be opened or read.

Examples:
  cmp ///remote-host-a/tmp/a.bin some/dir/a.bin
  cmp -s ///remote-host-a/etc/hostname ///freebsd/etc/hostname
```

#### `md5sum`

> Print or check MD5 digests
> 
> Group: Verification, Splitting, and Comparison · Help trigger: `--help` · Capture exit code: 0 · 19 lines

```text
Usage: md5sum [-b] [-c list] path ...

Print the digest of every path.  A path is either local
("some/dir/a.bin") or a url ("///remote-host-a/tmp/a.bin", "https://...");
any mix is allowed on one command line and each file is read
once, straight through, on whichever side holds it.

Options:
  -b        mark the path with '*' (binary; text mode is the default)
  -c list   read digests from list and verify them

The list has one "<hex>  <path>" per line, exactly what this
command prints, so "md5sum ... > list" and "md5sum -c list" round trip
across endpoints.

Examples:
  md5sum ///remote-host-a/etc/hostname
  md5sum -c ///remote-host-a/tmp/files.md5
  md5sum some/dir/a.iso ///remote-host-b/some/dir/b.iso
```

#### `split`

> Split a file into pieces
> 
> Group: Verification, Splitting, and Comparison · Help trigger: `--help` · Capture exit code: 0 · 15 lines

```text
Usage: split [-b SIZE] [-l N] [-a N] [input [prefix]]

Split a file into pieces.  input may be local, an endpoint url or
anything else a file driver serves (http, ...); the pieces are
written through the same driver, so prefix may name an endpoint
directory too.  With no input the standard input is used.

Options:
  -b SIZE  bytes per piece, with an optional k, m or g suffix
  -l N     lines per piece (default 1000)
  -a N     length of the suffix (default 2, i.e. aa, ab, ...)

Examples:
  split -l 1000 ///remote-host-a/var/log/messages some/dir
  split -b 1M some/dir/a.bin ///remote-host-a/tmp/chunk_
```

### 4.3 File and Directory Operations

#### `ls`

> List directory contents
> 
> Group: File and Directory Operations · Help trigger: `--help` · Capture exit code: 0 · 19 lines

```text
Usage: ls [-alhRd] [path ...]

A path is either local ("some/dir", "./sub") or a remote url
("///remote-host-a/etc").  Both may be mixed on one command line.
A component may also hold the wildcards * ? and [a-z]: rfsh
matches them itself, so they work on a remote volume too.

Options:
  -l   long format: mode, links, uid, gid, size, mtime
  -a   show names starting with '.'
  -h   human readable sizes, use with -l
  -R   recurse into sub directories
  -d   list the directory itself instead of its contents

Examples:
  ls ///remote-host-a/etc
  ls ///remote-host-a/tmp/*.log
  ls -l ///remote-host-a/etc/hostname /tmp
  ls -lhR ///remote-host-b/some/dir
```

#### `cp`

> Copy files and directories
> 
> Group: File and Directory Operations · Help trigger: `--help` · Capture exit code: 0 · 24 lines

```text
Usage: cp [-rfv] source ... target

A path may hold the wildcards * ? and [a-z]; rfsh matches them
itself, so a wildcard works on a remote volume too.  One that
matches nothing is an error, and the command then does nothing.

Every source and the target may be local ("some/dir/a.txt") or a
remote url ("///remote-host-a/tmp/a.txt").  When the target is an existing
directory each source is copied into it under its own name, which is
what makes the mixed forms below work.

Options:
  -r   copy directories recursively
  -f   if the target cannot be opened, remove it and retry
  -v   print every file as it is copied

The read/write block size is taken from $RF_ENV_BS (dd bs= style,
e.g. 2M / 256k), the same variable rfdd and rfcp read; 256K when
it is not set.

Examples:
  cp ///remote-host-a/tmp/a.txt /tmp/
  cp /tmp/a.txt b.txt ///remote-host-a/tmp/
  cp -r ///remote-host-a/etc/rc.d /tmp/rc.d
```

#### `rm`

> Remove files and directories
> 
> Group: File and Directory Operations · Help trigger: `--help` · Capture exit code: 0 · 26 lines

```text
Usage: rm [-rRfv] [-t] path ...

A path may hold the wildcards * ? and [a-z]; rfsh matches them
itself, so a wildcard works on a remote volume too.  One that
matches nothing is an error unless -f is given, and the command
then does nothing.

A path is either local ("some/dir/a.txt") or a remote url
("///remote-host-a/tmp/a.txt").  Both may be mixed on one command line.

Options:
  -r           remove directories and their contents
  -f           do not complain about paths that do not exist
  -v           print every path as it is removed
  -t, --recycle    move to the recycle bin instead of erasing
  -T, --no-recycle erase (default, same as omitting the option)

The recycle bin exists on Windows only.  A remote delete goes to
the bin of the machine holding the file, so "rm -t
///remote-host-b/some/dir" empties into winsrv's bin.  Against a posix
endpoint --recycle degrades to an erase, and rm says so.

Examples:
  rm ///remote-host-a/tmp/a.txt
  rm -r ///remote-host-a/tmp/old /tmp/old
  rm -t "///remote-host-b/some/dir"
```

#### `mv`

> Move (rename) files
> 
> Group: File and Directory Operations · Help trigger: `--help` · Capture exit code: 0 · 18 lines

```text
Usage: mv [-fv] source ... target

A path may hold the wildcards * ? and [a-z]; rfsh matches them
itself, so a wildcard works on a remote volume too.  One that
matches nothing is an error, and the command then does nothing.

Both ends may be local or a remote url, and may differ: a move that
cannot be done with a rename (local <-> remote, or two endpoints) is
copied and then the source is removed.

Options:
  -f   replace an existing target without asking
  -v   print every path as it is moved

Examples:
  mv ///remote-host-a/tmp/a.txt /tmp/a.txt
  mv /tmp/a.txt ///remote-host-a/tmp/
  mv -v ///remote-host-b/some/dir ///remote-host-a/tmp/y
```

#### `rmdir`

> Remove empty directories
> 
> Group: File and Directory Operations · Help trigger: `--help` · Capture exit code: 0 · 18 lines

```text
Usage: rmdir [-v] [-t] dir ...

A path may hold the wildcards * ? and [a-z]; rfsh matches them
itself, so a wildcard works on a remote volume too.  One that
matches nothing is an error, and the command then does nothing.

Removes EMPTY directories only, the way rmdir always has: a directory
with content is refused, and "rm -r" is what you want instead.
Each dir may be a local path or a "///endpoint/path" url.

Options:
  -v           print every directory as it is removed
  -t, --recycle    move to the recycle bin instead of erasing
  -T, --no-recycle erase (default)

Examples:
  rmdir ///remote-host-a/tmp/empty /tmp/empty
  rmdir -t "///remote-host-b/some/dir"
```

#### `ln`

> Create hard and symbolic links
> 
> Group: File and Directory Operations · Help trigger: `--help` · Capture exit code: 0 · 17 lines

```text
Usage: ln [-sfv] target ... link_name

Any of the names may be a local path or a "///endpoint/path" url.
The target of a symbolic link is stored as typed and never resolved,
so it may be relative, may not exist yet, and may point at a path
inside the same endpoint.

Options:
  -s   make a symbolic link (default is a hard link)
  -f   replace an existing link name
  -v   print every link as it is made

Examples:
  ln -s ///remote-host-a/etc/hostname /tmp/hl
  ln -s a.txt b.txt
  ln  ///remote-host-a/tmp/a.txt ///remote-host-a/tmp/b.txt
  ln -sfv /tmp/a.txt ///remote-host-b/some/dir/a.lnk
```

#### `link`

> Create a hard link
> 
> Group: File and Directory Operations · Help trigger: `--help` · Capture exit code: 0 · 7 lines

```text
Usage: link target link_name

A hard link is a second name for one file: it needs both names on
the same volume and cannot name a directory.

Examples:
  link ///remote-host-a/tmp/a.txt ///remote-host-a/tmp/b.txt
```

#### `mkdir`

> Create directories
> 
> Group: File and Directory Operations · Help trigger: `--help` · Capture exit code: 0 · 13 lines

```text
Usage: mkdir [-pv] dir ...

Each dir may be a local path ("some/dir") or a remote url
("///remote-host-a/tmp/a"); both may be mixed on one command line.

Options:
  -p   create missing parents, and do not fail when dir exists
  -v   print every directory as it is created

Examples:
  mkdir /tmp/a
  mkdir -p ///remote-host-a/tmp/a/b/c
  mkdir -p ///remote-host-b/some/dir some/dir
```

#### `stat`

> Show file metadata
> 
> Group: File and Directory Operations · Help trigger: `--help` · Capture exit code: 0 · 19 lines

```text
Usage: stat [-c FORMAT] path ...

Print the metadata of each path: type, mode, size, links, owner,
and the access/write/create times.  A path may be local
("some/dir") or a remote url ("///remote-host-a/tmp/a"); a symbolic
link is described itself, not what it points at.

Options:
  -c FORMAT   print one line per file using FORMAT.  Conversions:
                %n name          %s size           %b blocks
                %h links         %i inode          %d device
                %F type          %a octal mode     %A symbolic mode
                %u uid           %g gid            %f raw mode (hex)
                %w/%W birth       %x/%X access      %y/%Y modify
                %z/%Z change (epoch with X/Y/Z, human otherwise)

Examples:
  stat ///remote-host-a/tmp/a.txt
  stat -c '%n %s %A' some/dir/a.txt ///remote-host-b/some/dir/b.txt
```

#### `touch`

> Change file timestamps
> 
> Group: File and Directory Operations · Help trigger: `--help` · Capture exit code: 0 · 15 lines

```text
Usage: touch [-c] [-t TIME] path ...

Set the times of each path to now, creating an empty file when it
does not exist yet.  A path may be local ("some/dir") or a
remote url ("///remote-host-a/tmp/a"); both may be mixed.

Options:
  -c           do not create a missing file, only update existing ones
  -t TIME      use TIME instead of now; the format is
               [[CC]YY]MMDDhhmm[.ss] (e.g. 202401311200.30)

Examples:
  touch ///remote-host-a/tmp/a.txt
  touch -c some/dir/maybe.txt ///remote-host-b/some/dir/other.txt
  touch -t 202401311200.30 some/dir/a.txt
```

#### `chmod`

> Change permission bits (posix endpoints)
> 
> Group: File and Directory Operations · Help trigger: `--help` · Capture exit code: 0 · 24 lines

```text
Usage: chmod [-R] [-v] mode path ...

A path may hold the wildcards * ? and [a-z]; rfsh matches them
itself, so a wildcard works on a remote volume too.  One that
matches nothing is an error, and the command then does nothing.

Change the permission bits of files on a posix endpoint.

Options:
  -R   recurse into directories
  -v   name every file whose mode actually changed

mode is octal ("755", "0644") or symbolic ("u+x", "go-w",
"a=rX").  Symbolic modes understand ugoa, +-= and rwxX; setuid,
setgid and the sticky bit are ignored.

A windows endpoint is refused: it has attributes and ACLs, not a
mode, and mapping one onto the other silently would make a mixed
command line do two different things.

Examples:
  chmod 755 ///remote-host-a<user-home>/deploy.sh
  chmod -R a+rX ///remote-host-a<user-home>/pub
  chmod u+x ///remote-host-a/tmp/run.sh
```

#### `df`

> Show volume capacity
> 
> Group: File and Directory Operations · Help trigger: `--help` · Capture exit code: 0 · 13 lines

```text
Usage: df [-h] [path ...]

Show the capacity of the volume behind each path.  A path may be
local ("some/dir") or a remote url ("///remote-host-a/tmp"); the endpoint
answers with the numbers of the machine that owns the files.
With no path, the current directory is used.

Options:
  -h   powers of 1024 (1K 234M 2G) instead of 1K blocks

Examples:
  df
  df -h ///remote-host-a/ ///remote-host-b/some/dir
```

#### `find`

> Search a local or a remote tree
> 
> Group: File and Directory Operations · Help trigger: `-h` · Capture exit code: 1 · 31 lines

```text
find: unknown predicate '-h'
Usage: find [path ...] [-name pat] [-iname pat] [-type f|d|l|b|c]
                   [-newer file] [-size [+-]N[cwbkMG]] [-maxdepth N]
                   [-mindepth N]

Walk each path and print what matches.  A path is local
("some/dir") or a remote url ("///remote-host-a<user-home>"); the
walk itself runs on the endpoint that owns the tree, one opendir
per directory, no per-entry round trip.

Hits are printed the way the root was typed, so the output can be
piped into the other fs commands unchanged:
  find ///remote-host-a/tmp -name "*.log"    ->  ///remote-host-a/tmp/a.log

Options:
  -name pat        match the last component against a glob (* ? [..])
  -iname pat       same, ignoring case
  -type t          f file, d directory, l symlink, b block, c char
  -newer file      only entries modified after that file
  -size N          size test; default unit is a 512 byte block
                   c bytes, w words, b blocks, k KiB, M MiB, G GiB
                   +N greater, -N less, N exactly
  -maxdepth N      do not descend past N levels (0 = the root only)
  -mindepth N      do not report anything above N levels

Symbolic links are reported but never followed.

Examples:
  find ///remote-host-a<user-home>/work/rfs -name "*.c"
  find some/dir -type f -size +1M
  find ///remote-host-b/some/dir -name "*.log" -newer some/dir
```

#### `grep`

> Search for patterns in files
> 
> Group: File and Directory Operations · Help trigger: `--help` · Capture exit code: 0 · 45 lines
> 
> Note: at runtime `--help` returns an **empty string** (exit 0); `-h` means `--no-filename`, not help. See §5.6 for the root cause: the usage text exceeds the 1KB buffer of the error output function, so the entire block is discarded. The usage below was extracted by `grep_usage()` (source fallback); example paths have been redacted.

```text
Usage: grep [OPTION]... PATTERN [FILE]...
        [OPTION]... [-e PATTERN | -f FILE] [FILE]...

Search for PATTERN in each FILE (or standard input).  A FILE may be a
local path ("some/dir/a.txt") or a remote url ("///remote-host-a/tmp/a.log"),
and several may be mixed on one command line.  With -r the search
descends into directories on the endpoint that owns them.

Options:
  -i, --ignore-case       ignore case distinctions
  -v, --invert-match      select non-matching lines
  -n, --line-number       prefix each line with its line number
  -c, --count             print only a count of matching lines
  -l, --files-with-matches   print only names of files with matches
  -L, --files-without-match  print only names of files without matches
  -h, --no-filename       suppress the file name prefix
  -H, --with-filename     always print the file name prefix
  -q, --quiet, --silent   suppress output, exit status only
  -r, --recursive         read all files under each directory
  -R, --dereference-recursive  like -r but follow symlinks
  -m, --max-count=N       stop after N matching lines per file
  -A, --after-context=N   print N lines of trailing context
  -B, --before-context=N  print N lines of leading context
  -C, --context=N         print N lines of output context
  -o, --only-matching     print only the matched parts of a line
  -w, --word-regexp       match only whole words
  -x, --line-regexp       match only whole lines
  -F, --fixed-strings     PATTERN is a literal string
  -E, --extended-regexp   PATTERN is an extended regex (| + ? ( ) active)
  -G, --basic-regexp      PATTERN is a basic regex (the default)
  -e PATTERN              use PATTERN (may be given more than once)
  -f FILE                 take patterns from FILE, one per line
      --include=GLOB      search only files whose name matches GLOB
      --exclude=GLOB      skip files whose name matches GLOB
      --exclude-dir=GLOB  skip directories whose name matches GLOB

The default pattern is a basic regex (BRE): . * ^ $ [ ] and \ escape are
  active; | + ? ( ) are literal unless escaped (\| \( \) \+ \?) or -E.
  -E makes it an extended regex where | + ? ( ) are active.  -F makes it a
  plain literal.  Multiple -e/-f patterns are OR'd.

Examples:
  grep "TODO" ///remote-host-a<user-home>/work/rfs/src
  grep -rin error some/dir
  grep -rF "=== cut ===" ///remote-host-b/some/dir
```

### 4.4 Time and Scheduling

#### `ntpdate`

> Set the system time from an NTP server
> 
> Group: Time and Scheduling · Help trigger: `-h` · Capture exit code: 0 · 27 lines

```text
Usage: ntpdate [options] <server> [server ...]
       ntpdate -a [options]

A server must be given explicitly, so a bare "ntpdate" can never
change the clock by accident.  -a opts in to the default server:
"pool.ntp.org", or the NTP_SERVERS environment variable when it is set.

Options:
  -a             use the default server when no server is listed
  -p <port>      NTP server port (default: 123)
  -t <sec>       timeout of one server, in seconds (default: 5)
  -q             query only: print offset/delay, do not set the clock
  -v             verbose output
  -h             show this help

Environment:
  NTP_SERVERS    space/comma separated server list used by -a,
                 e.g. "ntp1.corp ntp2.corp"

Examples:
  ntpdate time.windows.com                    one server
  ntpdate -t 3 ntp.aliyun.com time.nist.gov   try them in order
  ntpdate -a                                  default server
  ntpdate -a -q                               query the default only

Note:
  setting the clock needs Administrator on windows and root on unix.
```

#### `ntpd`

> NTP server: hand our clock out to clients
> 
> Group: Time and Scheduling · Help trigger: `-h` · Capture exit code: 0 · 23 lines

```text
Usage: ntpd [options]

A small NTP server: it answers client requests with our own clock.
Without -s the clock is never written, ntpd is then read only.

Options:
  -p <port>      listen port (default: 123)
  -l <addr>      listen address (default: any, i.e. 0.0.0.0)
  -S <n>         stratum to announce, 1..15 (default: 10)
  -s <host>      upstream server to sync from, up to 4 times
  -i <sec>       upstream poll interval (default: 64)
  -t <sec>       upstream timeout of one server (default: 5)
  -d             run as a daemon
  -v             verbose output
  -h             show this help

Examples:
  ntpd -p 1123                       serve on a high port
  ntpd -d                            daemonize, stratum 10
  ntpd -s ntp.aliyun.com -s ntp.tencent.com -d

Note:
  binding port 123 needs Administrator on windows and root on unix.
```

#### `crond`

> Unix scheduler for automating tasks
> 
> Group: Time and Scheduling · Help trigger: `-h` · Capture exit code: 0 · 26 lines

```text
crond [opt]
	-c <file>  Config file to read, default: crond.conf
	-p         Parse the config, dump the settings and exit
	-d         Run as a daemon
	-E         List the environment variables crond honours
	-h         Display this help

Example:
  crond -c /etc/crond.conf -d
  crond -c crond.conf -p

Config file (traditional crontab):
  # m  h  dom  mon  dow  [user]  command
  15 2  1    *    *      /usr/local/bin/check.sh
  15 2  1    *    *  !   /usr/local/bin/daemon -x
  0  3  *    *    *  root  /sbin/backup --all

The optional user runs the job as that account (posix only).
A command whose FIRST character is '!' is started in the
background: crond does not wait for it and does not capture its
output.  Every other command is run to completion and its
stdout/stderr and exit code are logged.

With -p the dump is printed in two parts: an overview table, then
one block per job that expands every time field and spells out
the effective matching rule.
```

### 4.5 Services and Remote Access

#### `telnetd`

> simpe telnetd
> 
> Group: Services and Remote Access · Help trigger: `--help` · Capture exit code: 1 · 19 lines

```text
Usage: telnetd [options] <listen_url>

Options:
  -r <url>       Remote execution backend.
                 tcp://host:port  : forward to TCP backend
                 ///host          : launch shell via rfsd

  -l <cmd>       Shell or command to launch when no -r is used.
                 Example: cmd, powershell, /bin/bash

  -w <dir>       Working directory for launched shell.

Examples:
  telnetd -l cmd tcp://0.0.0.0:2323
  telnetd -r ///local-host tcp://0.0.0.0:2323
  telnetd -r tcp://127.0.0.1:2323 tcp://0.0.0.0:2323

Note:
  <listen_url> follows net_server_init syntax.
```

#### `httpd`

> simple httpd
> 
> Group: Services and Remote Access · Help trigger: `-h` · Capture exit code: 0 · 11 lines

```text
httpd [opt] [port]
	-b [addr] Bind address, default: 127.0.0.1
	-P [port] Tcp port to listen on, default: 8000
	-C [dir]  Directory to serve, default: current local directory
	-h        Display this help

Example:
  httpd 8080
  httpd -C /tmp -b 0.0.0.0 -P 8000

Press Ctrl+C to stop the server.
```

#### `rftd`

> ftpd server
> 
> Group: Services and Remote Access · Help trigger: `-h` · Capture exit code: 0 · 19 lines

```text
rftd-windows-x64 v<version> - RANFS FTP Server
Usage: rftd [opt] [arguments] ...
	-P [port] ftp server tcp port, overrides rftd:ftp_server_port
	-b [addr] ftp server bind address, default: 127.0.0.1
	-C [dir]  directory to serve, default: current start directory
	-N ignore the config file, use built-in defaults
	-c [config_file]  set config file
	-p dump current config
	-s [key=val] Set configuration options
	-E List the environment variables the program honours
	-e ["cmd;..."] execute string 'cmd'
	-v show version
	-q Do not display the startup banner and copyright message
	-d Run as a service
	-i Install service
	-u uninstall service
	-h display this help

Example: rfsh rftd -C some/dir -P 2121
```

#### `rfbd`

> nbd server
> 
> Group: Services and Remote Access · Help trigger: `-h` · Capture exit code: 0 · 16 lines

```text
rfbd-windows-x64 v<version> - RANFS Network Block Device Service
Usage: rfbd [opt] [arguments] ...
	-b [addr]  nbd server bind address, default: 127.0.0.1
	-P [port]  nbd server tcp port, overrides rfbd:nbd_server_port
	-N ignore the config file, use built-in defaults
	-c [config_file]  set config file
	-p dump current config
	-E list the environment variables the program honours
	-s [list|key=val] Set configuration options
	-e ["cmd;..."] execute string 'cmd'
	-v show version
	-q Do not display the startup banner and copyright message
	-d Run as a service
	-i Install service
	-u uninstall service
	-h display this help
```

#### `rfsd`

> rfsd server
> 
> Group: Services and Remote Access · Help trigger: `-h` · Capture exit code: 0 · 18 lines

```text
rfsd-windows-x64 v<version> - RFSD File RPC Service
Usage: rfsd [opt] [arguments] ...
	-b [addr] rfp server bind address, default: 127.0.0.1
	-P [port] rfp server tcp port, overrides rfsd:rfp_server_port
	-N ignore the config file, use built-in defaults
	-c [config_file]  set config file
	-p dump current config
	-E list the environment variables the program honours
	-s [list|key=val] Set configuration options
	-e ["cmd;..."] execute string 'cmd'
	-v show version
	-q Do not display the startup banner and copyright message
	-d Run as a service
	-i Install service
	-u uninstall service
	-o [log_file]     set output log file
	-l [log_level]    set log level: verb, dbg, info, warn, err
	-h display this help
```

#### `rcli`

> remote client tool
> 
> Group: Services and Remote Access · Help trigger: `-h` · Capture exit code: 0 · 15 lines

```text
Usage: rcli [cmd] [param] ...

  rcli                              list all saved clients
  rcli info      <url>              show the rfsd info (ver/plat/flags)
  rcli lsblk     <url>              show the lsblk of a client
  rcli blkinfo   <url><dev>         show the partition table of a device
  rcli smartinfo <url>[<dev>]       show the smart info of a disk

<url> is a session url, e.g. \\\name or ///name
<dev> is the device path, e.g. /dev/sda or \\.\PhysicalDrive0

  rcli info      \\\host
  rcli lsblk     \\\host
  rcli blkinfo   \\\host\\.\PhysicalDrive0
  rcli smartinfo \\\host\\.\PhysicalDrive0
```

#### `rsh`

> rsh shell
> 
> Group: Services and Remote Access · Help trigger: `--help` · Capture exit code: 1 · 79 lines

```text
Usage: rsh [options] <url>

Options:
  -u <user>      Specify the user to run the remote shell as
  -U             List the users the remote shell can run as
  -l <shell>     Specify the remote shell (default: system shell)
  -c <command>   Execute a single command and exit
  -w <dir>       Set working directory for remote shell/command
  -f <file>      Read commands from local file ('-' = stdin pipe)
  -F <file>      Same as -f, but keep it as one multi-line block
  -s             Read commands from stdin as one multi-line block
  -m             Wait for keypress before exit if failed
  -h             Show this help

Remote user selected by -u:
  rfsd runs as a Windows service, so the shell starts from a token of
  a logon session instead of from rfsd itself.

  nt\system      SYSTEM (LocalSystem) privileges: no logon session and
                 no interactive desktop, so it works when no user is
                 logged on. Reserved alias, not a real account name
                 (that one is NT AUTHORITY\SYSTEM), so it cannot clash
                 with a user name; matched case-insensitively.
  <user>         Reuse the token of that user's interactive logon
                 session; "domain\user" or a bare name, matched
                 case-insensitively against the user name.
  (omitted)      The active console session, else the first active one.

  No matching session or no token -> the request fails with an
  error instead of silently running as SYSTEM.
  Windows only; on POSIX the session keeps rfsd's own context.
  Use -U to list the users available on the remote.

Examples:
  rsh -U ///host                       list the users rfsd can run as
  rsh -u <user> ///host -c 'id'        run a command as one of those users
  rsh -u nt\system ///host -c 'cmd'    run as SYSTEM (Windows only)

Remote shells accepted by -l:
  Windows        cmd, powershell, pwsh   (also powershell_ise)
  POSIX          bash, sh
  Any other      run as-is with "-c <cmd>" if no matching shell rule

  Only real shells belong here. Interpreters such as python, perl or
  node are not shells: run them as one command instead, e.g.
    rsh -c "python -c 'print(1)'" ///host
    rsh -c "python build.py"      ///host
  which keeps -l for the shell and lets that shell start the program.

  The value may be a bare name or a full path, e.g.
    -l pwsh
    -l "some/dir/powershell.exe"
    -l /bin/bash
  Default when -l is omitted: cmd on Windows, sh on POSIX.
  pwsh is just a short alias for powershell (same executable), so
  the user does not have to type the full name; both spellings
  start powershell. powershell_ise is a different program.

Command quoting per shell:
  cmd           uses  /Q /C "<cmd>"
  powershell    uses  -NoLogo -NoProfile -Command "<cmd>"
  pwsh          same as powershell
  bash/sh       uses  -c "<cmd>"

  With -c the command is a single line. For PowerShell separate
  statements with ';' because a multi-line string is truncated at
  the first newline. To run a real multi-line script use -F or -s:
  the block is fed to the remote shell's stdin, which is the only
  way to run multi-line syntax on Windows.

Note: -c, -f/-F and -s are mutually exclusive.
      -c also accepts '@<file>' (or '@-') as the command source,
      e.g. rsh -f build.sh ///host  ==  rsh -c @build.sh ///host

      With -f every line becomes one command (lines joined by ';'),
      empty lines and '#' comment lines are skipped.
      -F/-s send the whole block to the remote shell stdin, so
      multi-line syntax (for/do/done, if/fi, ...) is preserved;
      max 65536 bytes.
```

#### `rcp`

> rcp fast copy file
> 
> Group: Services and Remote Access · Help trigger: `--help` · Capture exit code: 1 · 84 lines

```text
rfcp v<version> [little] - Quickly copy synced files

Recursive directory copy / mirror sync / listing tool. Works on local
paths and over the rfs network (///device/alias/path, aliases from
rf_client.ini).

usage: rfcp mode=MODE if=SRC [of=DST] [flag=F,...] [param=K=V,...]
            [filter=PATTERN,...] [olist=FILE] [bs=N] [level=LEVEL]

modes (mode=...):
  cp                   copy everything, overwrite existing dst files
  copy_diff_size_date  copy only files whose size or mtime differs
  copy_diff_size_hash  copy only files whose size or hash differs
  sync                 mirror SRC into DST: copies new/changed files
                       and DELETES dst files missing in SRC
  sync_diff_size_hash  mirror, compare by size+hash instead of date
  ls                   list files under if= to stdout (dirs end with '/')
  statfs               show filesystem info of if=
  ls_mode=PREFIX       print supported modes starting with PREFIX

sources / targets:
  if=URL     source dir or file to read from
  of=URL     destination dir (not needed by ls / statfs)
  olist=FILE write the ls listing to FILE as well

filter= (comma separated, narrows the enumeration scope; files
outside the filter are never copied and never deleted by sync):
  *.c            include files matching pattern (any depth)
  dir/           include everything under any dir/ (trailing '/')
  -*.log         exclude files matching pattern
  -dir/          exclude directory dir/ and everything under it

flags= (comma separated):
  file_ops       print one line per action to stdout:
                 '+' add  '-' delete  '#' kept (no_del_dir)
                 'S' synced (size differs)  'H' synced by hash
                 'T' synced by date  'P' synced by type  'L' by link
                 no line for a file means it was skipped
  dry_run        like file_ops but nothing is written or deleted
  no_del_dir     sync keeps extra dst files/dirs (report '#' not '-')
  acl            copy POSIX ACLs
  hardlinks      preserve hard links between copied files
  alt_stream     copy NTFS alternate streams / Linux xattrs (alias xattr)
  i_rdir         recurse into subdirs on the input side
  o_rdir         recurse into subdirs on the output side
  a_rdir         recurse into subdirs on both sides
  sync_reason    log the reason each file is synced
  stat           print run statistics (last line = final total)
  lstat          print last statistics
  debug          print performance counters
  del_direct     delete directly instead of moving to recycle bin
  dbg_filt       debug the filter matching

  sync_algo=auto|hash|rsync  content sync algorithm (default auto)
  sync_bs_count=N            blocks per hash batch (default 1024)
  retry_count=N              retry whole job on timeout (default 1)
  sync_cal_timeout=S         per-file hash timeout, seconds (default 30)
  max_read_timeout=S         read timeout, seconds (default 300)
  hash_algo=NAME             hash used by *_hash modes (md5, sha1, ...)
  hash_max_size=S            skip hashing files bigger than S (128M)
  user_name=NAME             owner name for created files
  group_name=NAME            group name for created files
  file_mode=NNN              octal file mode (default 0644)
  dir_mode=NNN               octal dir mode (default 0755)
  max_rate=SPEED             limit transfer rate (e.g. 10M)
  test_inject_timeout_at=S   testing: inject a timeout after S bytes

  bs=N           io block size (default 2M, or $RF_ENV_BS)
  level=LEVEL    log level [verb, dbg, info, warn, err]

notes:
  - mtime comparison tolerance is 2 seconds
  - cp keeps the source mtime on copied files
  - sync makes DST identical to SRC (one direction only);
    swap if=/of= to pull instead of push

examples:
  rfcp mode=cp if=some/dir of=///remote-host-c/some/dir           first full copy
  rfcp mode=sync if=some/dir of=///remote-host-c/some/dir flag=dry_run  preview
  rfcp mode=sync ... flag=file_ops,no_del_dir          ops + keep extra
  rfcp mode=ls if=some/dir filter=*.c olist=out.txt      save a listing

sizes may be suffixed by b(512), kB(1000), k(1024), MB(1000000), M,
GB, G, TB, T
```

#### `rdd`

> rdd power dd
> 
> Group: Services and Remote Access · Help trigger: `--help` · Capture exit code: 1 · 86 lines

```text
rfdd v<version> [little] - convert and copy a file [staic]

dd-style single file converter/copier. Reads if= and writes of=,
byte-exact, locally or over the rfs network (of=///device/path).

usage: rfdd if=FILE of=FILE [bs=N] [count=N] [skip=N] [seek=N]
            [conv=CONV,...] [iflag=F,...] [oflag=F,...] [status=S]

input / output:
  if=FILE         read from FILE or device (default stdin)
  of=FILE         write to FILE, device or ///device/path (default stdout)
  bs=N            read+write block size, sets ibs and obs (default 2M,
                  or $RF_ENV_BS)
  ibs=N           input block size only (default 2M, or $RF_ENV_BS)
  obs=N           output block size only (default 2M, or $RF_ENV_BS)

positioning (skip/seek count BLOCKS; use the *_bytes flags for bytes):
  skip=N          skip N ibs-sized blocks of input before copying
  seek=N          skip N obs-sized blocks of output before writing
  offset=N        shorthand for skip=seek=N in BYTES (iflag=skip_bytes
                  and oflag=seek_bytes are set automatically;
                  conv=off_blocks switches offset back to blocks)
  count=N         copy only N blocks (count_bytes=N to count bytes)

conv=CONV,... :
  notrunc         do not truncate of=: data is written at the seek
                  position, existing bytes after it are preserved
  resume          continue an interrupted copy: skip the first
                  (current size of of=) input bytes and append
  noerror         continue after read errors
  bad_read        allow damaged sector fills to continue reading
  sync            pad short reads with zeros
  fsync           physically write data out before finishing
  swab            swap every pair of bytes
  off_blocks      offset=N is in blocks instead of bytes
  cal_one_task    hash/diff block count computed in one thread
  cal_force_local force local hash/diff calculation

iflag= / oflag= (comma separated):
  skip_bytes      skip=N is in bytes (iflag)
  seek_bytes      seek=N is in bytes (oflag)
  direct          use direct I/O
  file            open as a plain file, else parse as image format
  vss             read from a Windows shadow copy (iflag only)

status= end-of-run report: none | noxfer (no rate) | md5 | sha1

damaged source handling:
  retry_open=N             max reopen attempts on io errors
  retry_delay_seconds=N    delay between retries
  retry_timeout_minutes=N  stop retrying after N minutes
  bad_retry_count=N        max retries per damaged sector read
  bad_skip_sectors=N       skip damaged sectors
  bad_read_timeout_s=N     abort a stalled sector read after N s
                           (default 15; 0 = driver default)
  bad_fill_str=STR         unreadable-block fill pattern: used by
                           conv=bad_read and by a plain copy whose
                           read fails (marks the block, not zero fill)
                           (default "UNREADABLESECTOR", 'zero' = 0x00)

hash / diff / clear modes:
  hash_mode=NAME    compute hash of the copied data:
                    [crc32c|md5|sha1|sha256|sha512|sm3|xxh3] [+p...]
  diff_mode=MODE    compare if= with of=: byte | bs | bin
  diff_max_count=N  max reported diff positions [1-8192]
  sync_mode=[auto]  synchronize (patch) of= from if= differences
  bs_count=N        hash/diff blocks per batch [1-4096] (default 1024)
  bcount_mode=u8    compute byte-value distribution of the data
  clear_mode=XX     fill output with byte XX (00-FF hex; 100=random)

misc:
  mbs=N                       sync/diff block size (default 64k)
  disable_os_hibernate=[1|0]  prohibit os hibernate during operation
  disable_pack_transport=[1|0]  disable pack transport
  cool_down=[W-S]             work W minutes, sleep S minutes, repeat
  proxy_name=NAME             rf_proxy.ini section name
  proxy_url=[http|sock4|sock5]://...  proxy url
  level=LEVEL                 log level [verb, dbg, info, warn, err]

examples:
  rfdd if=some/dir/a.iso of=///remote-host-c/some/dir/a.iso status=md5   copy with md5
  rfdd if=SRC of=DST offset=1K count=4K   byte-based partial copy
  rfdd if=SRC of=DST seek=1M iflag=skip_bytes oflag=seek_bytes conv=notrunc

sizes may be suffixed by b(512), kB(1000), k(1024), MB(1000000), M,
GB, G, TB, T
```

### 4.6 Runtimes and Utilities

#### `m7z`

> 7z compress and decompress
> 
> Group: Runtimes and Utilities · Help trigger: `no arguments` · Capture exit code: 0 · 9 lines
> 
> Note: usage is printed only when running with no arguments at all; passing `-h`/`--help` instead reports `incorrect command`.

```text
7z Decoder <3rd-party version> : Igor Pavlov : Public domain : <date>

Usage: 7zDec <command> <archive_name>

<Commands>
  e: Extract files from archive (without using directory names)
  l: List contents of archive
  t: Test integrity of archive
  x: eXtract files with full paths
```

#### `rfue`

> rfue tool
> 
> Group: Runtimes and Utilities · Help trigger: `-h` · Capture exit code: 0 · 16 lines

```text
rfue-windows-x64 v<version> - rfp/rfps Dokan
Usage: rfue [opt] [arguments] ...
	-u [url] Specify 'url' to mount
	-m [MountPoint] Can be some/dir (drive letter) or empty NTFS folder
	-r ["debug=1&..."] set url query val
	   options=rw,removable,case_sensitive
	-i [idx] Specify 'idx' named pipe index name
	-c [config_file]  set config file
	-p dump current config
	-s [list|key=val] Set configuration options
	-e ["cmd;..."] execute string 'cmd'
	-v show version
	-q Do not display the startup banner and copyright message
	-o [log_file]     set output log file
	-l [log_level]    set log level: verb, dbg, info, warn, err
	-h display this help
```

#### `raid`

> raid tool
> 
> Group: Runtimes and Utilities · Help trigger: `--help` · Capture exit code: 1 · 5 lines

```text
Usage: raid [options] <url>

Options:
  -p            Show raid info
  -h            Show this help
```

#### `sqlite`

> sqlite tool
> 
> Group: Runtimes and Utilities · Help trigger: `--help` · Capture exit code: 1 · 44 lines

```text
Usage: sqlite [OPTIONS] [FILENAME [SQL]]
FILENAME is the name of an SQLite database. A new database is created
if the file does not previously exist. Defaults to :memory:.
OPTIONS include:
   --                   treat no subsequent arguments as options
   -append              append the database to the end of the file
   -ascii               set output mode to 'ascii'
   -bail                stop after hitting an error
   -batch               force batch I/O
   -box                 set output mode to 'box'
   -column              set output mode to 'column'
   -cmd COMMAND         run "COMMAND" before reading stdin
   -csv                 set output mode to 'csv'
   -deserialize         open the database using sqlite3_deserialize()
   -echo                print inputs before execution
   -init FILENAME       read/process named file
   -[no]header          turn headers on or off
   -help                show this message
   -html                set output mode to HTML
   -interactive         force interactive I/O
   -json                set output mode to 'json'
   -line                set output mode to 'line'
   -list                set output mode to 'list'
   -lookaside SIZE N    use N entries of SZ bytes for lookaside memory
   -markdown            set output mode to 'markdown'
   -maxsize N           maximum size for a --deserialize database
   -memtrace            trace all memory allocations and deallocations
   -mmap N              default mmap size set to N
   -newline SEP         set output row separator. Default: '\n'
   -nofollow            refuse to open symbolic links to database files
   -nonce STRING        set the safe-mode escape nonce
   -nullvalue TEXT      set text string for NULL values. Default ''
   -pagecache SIZE N    use N slots of SZ bytes each for page cache memory
   -pcachetrace         trace all page cache operations
   -quote               set output mode to 'quote'
   -readonly            open the database read-only
   -safe                enable safe-mode
   -separator SEP       set output column separator. Default: '|'
   -stats               print memory stats before each finalize
   -table               set output mode to 'table'
   -tabs                set output mode to 'tabs'
   -unsafe-testing      allow unsafe commands and modes for testing
   -version             show SQLite version
   -vfs NAME            use NAME as the default VFS
```

#### `curl`

> curl tool
> 
> Group: Runtimes and Utilities · Help trigger: `--help` · Capture exit code: 0 · 17 lines

```text
Usage: curl [options...] <url>
 -d, --data <data>          HTTP POST data
 -f, --fail                 Fail fast with no output on HTTP errors
 -h, --help <category>      Get help for commands
 -i, --include              Include protocol response headers in the output
 -o, --output <file>        Write to file instead of stdout
 -O, --remote-name          Write output to a file named as the remote file
 -s, --silent               Silent mode
 -T, --upload-file <file>   Transfer local FILE to destination
 -u, --user <user:password> Server user and password
 -A, --user-agent <name>    Send User-Agent <name> to server
 -v, --verbose              Make the operation more talkative
 -V, --version              Show version number and quit

This is not the full help, this menu is stripped into categories.
Use "--help category" to get an overview of all categories.
For all options use the manual or "--help all".
```

#### `ubpf`

> simpe ubpf
> 
> Group: Runtimes and Utilities · Help trigger: `--help` · Capture exit code: 0 · 17 lines

```text
usage: ubpf [-h] [-j|--jit] [-m|--mem PATH] BINARY

Executes the eBPF code in BINARY and prints the result to stdout.
If --mem is given then the specified file will be read and a pointer
to its data passed in r1.
If --mem is not given, r1 will be NULL. Programs that access r1 will crash.
NOTE: Programs verified with PREVAIL or similar verifiers assume r1 is non-null.
      Always provide --mem when running verified programs that access the context.
      See docs/VerifiedPrograms.md for more information.
If --jit is given then the JIT compiler will be used.

Other options:
  -r, --register-offset NUM: Change the mapping from eBPF to x86 registers
  -d, --data: Change from treating R_BPF_64_64 relocations as relocations to maps to relocations to data.
  -U, --unload: unload the code and reload it (for testing only)
  -R, --reload: reload the code, without unloading it first (for testing only, this should fail)
  -s, --main-function NAME: Consider the symbol NAME to be the eBPF program's entry point
```

#### `wasm3`

> simpe wasm3
> 
> Group: Runtimes and Utilities · Help trigger: `--help` · Capture exit code: 0 · 7 lines

```text
Usage:
  wasm3 [options] <file> [args...]
  wasm3 --repl [file]
Options:
  --func <function>     function to run       default: _start
  --stack-size <size>   stack size in bytes   default: 64KB
  --dump-on-trap        dump wasm memory
```

#### `lua`

> lua shell
> 
> Group: Runtimes and Utilities · Help trigger: `--help` · Capture exit code: 1 · 11 lines
> 
> Note: `--help` first reports `unrecognized option` and then prints Lua's own usage (the error line has been filtered out).

```text
usage: lua [options] [script [args]]
Available options are:
  -e stat   execute string 'stat'
  -i        enter interactive mode after executing 'script'
  -l mod    require library 'mod' into global 'mod'
  -l g=mod  require library 'mod' into global 'g'
  -v        show version information
  -E        ignore environment variables
  -W        turn warnings on
  --        stop handling options
  -         stop handling options and execute stdin
```

## 5. Field-Tested Notes and Pitfalls for AI Agents

### 5.1 Help Triggers Are Not Uniform (the Most Common Pitfall)

| Case | Behavior | Correct approach |
|---|---|---|
| File-class applets (`cat`/`head`/`ls`/`sort`/...) | `--help` prints full usage, exit 0 | Use `--help` |
| Framework apps (`rfsd`/`httpd`/`crond`/`rftd`/`ntpdate`/...) | `--help` first reports `invalid option -- -` then prints usage | Use `-h` |
| `grep` | `--help` has a handler branch but actually outputs an **empty string** with exit 0; `-h` means `--no-filename`; invalid options produce only a short error | Use the `grep_usage()` source fallback; root cause in §5.6 |
| `m7z` | Prints 7zDec usage only with **no arguments** | Do not pass `-h`/`--help` |
| `sqlite` | `-h` reports unknown option and suggests `Use -help`; `--help` prints the full option table | Use `--help` or `-help` |
| `lua` | `--help` reports `unrecognized option` but still prints Lua usage | Filter the error line before use |
| `raid` / `wasm3` / `ubpf` | Either `-h` or `--help` works, with slightly different text | Use the one without error lines |

### 5.2 Resident Service Commands

`rfsd` / `httpd` / `telnetd` / `ntpd` / `crond` / `rftd` / `rfbd` and similar commands **start a service and stay resident** when invoked without arguments.
Automated capture must: pass `-h` or `--help`, set a timeout, leave `stdin` empty, run each command in its own process, and verify afterward that no leftover processes or listening ports remain.

### 5.3 Text Encoding and Byte Semantics

- Text-reading commands such as `cat`/`head`/`tail`/`cut`/`sort`/`uniq`/`wc`/`sed`/`awk`/`grep`/`split` uniformly detect UTF-8, UTF-16LE, and UTF-16BE BOMs and transcode to UTF-8 for processing; the BOM itself is never printed.
- `od`/`hexdump`/`cmp`/`md5sum` are byte-exact tools: they do **not** strip BOMs or transcode, so digests and comparisons are computed on the raw bytes.
- For UTF-16 input, `tail` gives up its tail-seek optimization and scans sequentially; semantics are unchanged but it takes longer.

### 5.4 Paths and Remote Endpoints

- Local paths, remote `///<host>/...` paths, and URLs can be mixed; `-r`/`-R` recursion happens on **the endpoint that owns the directory**.
- Drive-letter paths, remote endpoints, and user home directories in help examples have been replaced with neutral placeholders (`some/dir/...`, `///<host>/...`, `<user-home>`); substitute real paths when copying into a live environment.

### 5.5 Relationship to the Lua Runtime Documentation

`lua` is just one applet in §2. Host APIs, the embedded module list, and availability status belong to a separate manual (`rfsh-lua-api`) and are not repeated here; both documents use the same generation and redaction conventions.

### 5.6 Known Defect: `grep` Help Is Invisible at Runtime

This section is based on a review of `fs_grep.c` and explains why `grep` in §4 can only be covered by a source fallback.

- **Symptom**: `rfsh grep --help` returns 0 with 0 bytes of output; `rfsh grep --bad-option` gives only a one-line `unrecognized option` error; `rfsh grep` with no arguments gives only `no pattern given`. None of the three shows usage.
- **Call chain**: `fs_grep_main()` calls `grep_usage()` in four places: `--help`, unrecognized long option, invalid short option, and missing pattern. `grep_usage()` writes to fd 2 via `grep_err(NULL, ...)`.
- **Root cause**: `grep_err()` uses a 1024-byte stack buffer with `vsnprintf`; the full `grep_usage()` text is about 2.4KB, so the entire formatted output is discarded once it overflows the buffer (short error messages are under 1KB and still display). This explains why a usage branch exists yet no help text appears at all — the shell layer is not intercepting `--help`.
- **Impact**: affects only help and error messages, **not search functionality**; `-h` in `grep` means `--no-filename`, not a help switch.
- **Fix options (choose one; requires a source change and rebuild)**: (1) enlarge the `grep_err()` buffer to hold the full usage text; (2) have `grep_usage()` call `grep_err()` multiple times, once per paragraph. After the fix, re-run the capture per §8.2: `grep` should switch from `source fallback` back to live output, and the fallback notes can be removed from this document.

### 5.7 Notes on `grep` Option Semantics (Source-Reviewed)

The usage in §4 is verbatim; the table below covers semantics that are easy to misread and most critical for AI-generated commands, also from `fs_grep.c`:

| Option / Semantics | Exact meaning |
|---|---|
| Default regex | BRE: `. * ^ $ [ ]` and backslash escapes are active; pipe, plus, question mark, and parentheses are literals unless escaped or `-E` is used |
| `-E` / `-G` / `-F` | Extended regex / force BRE / plain literal strings |
| `-e PATTERN` / `-f FILE` | Repeatable; multiple patterns are combined with **OR**; once used, the first non-option argument is no longer treated as a pattern |
| `-r` / `-R` | Both recurse; `-R` additionally follows symlinks, which `--no-dereference` disables |
| `--include=` / `--exclude=` / `--exclude-dir=` | Repeatable glob filters; apply to names only, not as path-prefix matching |
| `-m` / `-A` / `-B` / `-C` | Arguments may be attached (`-m3`) or space-separated (`-m 3`); `-C` sets both before and after context |
| `-q` / `-s` | `-q` returns only an exit status with no output; `-s` suppresses error messages |
| `-h` / `-H` | Disable / force filename prefixes; on by default for multiple files, off for a single file |
| Mixing local + remote | A single command line may combine local paths, `///<host>/...`, and URLs; recursion happens on the endpoint that owns the directory |

## 6. Copy-Paste Command Templates

```text
# 1) Get the authoritative command list
rfsh -a

# 2) Get help for a command (--help for file-class, -h for framework apps)
rfsh head --help
rfsh rfsd -h

# 3) Single-line / multi-line execution
rfsh -e "head -n 20 input.txt; wc -l input.txt"
rfsh -f job.txt

# 4) Text processing (BOM auto-detected)
rfsh -e "head -n 20 input.txt"
rfsh -e "sort -u input.txt | head -n 10"
rfsh -e "grep -rin error some/dir/"
rfsh -e "grep -E 'foo|bar' input.txt"

# 5) Mixing remote and local paths (placeholders; substitute real values)
rfsh -e "cp some/dir/input.txt ///remote-host-a/some/dir/"

# 6) Byte-exact tools (no transcoding)
rfsh -e "md5sum input.txt"
rfsh -e "hexdump -C input.txt | head -n 8"

# 7) Config overrides and environment information
rfsh -s list
rfsh -E
```

`input.txt` / `job.txt` / `some/dir/` in the templates are redacted placeholders, consistent with those in the help bodies.

## 7. Symbol Index (No Paths)

| Symbol / Option | Meaning | See also |
|---|---|---|
| `rfsh -a` | Lists all applets; single source of truth for the command list | §2 |
| `rfsh help` | Lists shell built-in commands | §3 |
| `-e` / `-f` / `-c` / `-s` / `-E` / `-o` / `-l` / `-v` / `-h` | Top-level options: command string / script file / config / config override / environment variables / log / log level / version / help | §1 |
| `grep_usage()` / `fs_grep_main()` | grep's usage text and entry point; source fallback when `--help` yields nothing at runtime | §4, `grep` |
| `-h` (grep) | **Not help**; equivalent to `--no-filename` | §5.1 |
| `-h` (framework apps) | This is the help switch for those programs | §5.1 |
| `--help` (file-class applets) | Prints full usage with exit 0 | §5.1 |
| `///<host>/...` | Remote endpoint path prefix | §1, §5.4 |
| `-r` / `-R` | Recursive (they differ in symlink following) | `grep`/`find` |
| `-n` / `-c` | Line count / byte count (semantics differ slightly among `head`/`tail`/`wc`) | §4 |
| `if=` / `of=` / `bs=` / `conv=` | dd-style copy arguments | `rdd` |
| `BLOCK_SET_*_TIMEOUT` | Block-device read/write timeout ioctls | §4, services and utilities |

This section lists symbol names only, no source paths: no project, build, or user directory should ever appear in a public document.

## 8. Generation / Update Procedures and Redaction Rules

### 8.1 Data Source Priority

1. **Live-run output** (`-a` / `help` / per-command help from the release binary) — highest priority.
2. **Embedded usage source** (e.g. `grep_usage()`) — fallback only when the text truly cannot be obtained at runtime, and the source and reason must be documented (here: `grep`, root cause in §5.6).
3. Repository READMEs / legacy docs / human memory — **must not** be used as the basis for command lists or options.

### 8.2 Update Procedure

```text
# A. Capture (script names kept, directories shown as placeholders; see the repo for actual locations)
python <repo>/scripts/gen_rfsh_help.py <rfsh-binary>
#    Produces tmp/rfsh_help/: _all.txt, _builtins.txt, _top_help.txt, <applet>.txt, _index.json

# B. Generate (applies uniform redaction; outputs both Markdown and a static site)
python <repo>/scripts/gen_rfsh_doc.py

# C. Run the redaction check — must be CLEAN
python <repo>/scripts/doc_privacy_check.py <output.md>

# D. Manual spot-check, then publish
```

Key constraints on the collector (do not drop these when editing the script):

- Each probe runs in its own process with a hard timeout and an empty `stdin`; **only `m7z` may be probed without arguments** — no resident service may ever run without arguments.
- Try both `--help` and `-h`, then pick the best by "has usage > no parser error lines > more complete content > exit 0"; filter noise lines such as `invalid option` / `unrecognized option` / `no pattern given`.
- Decode output as GBK, then write it back uniformly as UTF-8 with LF line endings.
- `_index.json` must record the chosen trigger, exit code, byte count, and line count for each command to support review.

### 8.3 Redaction Rules (Verify Line by Line Before Publishing)

| Category | Treatment |
|---|---|
| Version numbers | `v1.x.y.z` → `v<version>`; third-party decoder versions → `<3rd-party version>` |
| Build dates / dates | Remove the entire `(YYYY-M-D)` segment; standalone dates → `<date>` |
| Copyright / vendor banners | Delete whole lines containing copyright notices or vendor domains |
| Local drive-letter paths | Local paths like `<drive>:/dir/file.txt` → `some/dir/file.txt`; Windows absolute paths → `some/dir/file.exe` |
| Sample hostnames | Remote hostnames in verbatim help output → `///remote-host-a` / `///remote-host-b` / `///remote-host-c` / `///local-host` (keep them distinct) |
| User directories / usernames | Home directories → `<user-home>`; Windows user directories likewise → `<user-home>` |
| Project directories | Build, source, home, and workspace directories must never appear; the symbol index lists symbol names only |
| Environment variables | **Excluded as a class**: the `help env` dump must not enter any public artifact, and capture leftovers must be deleted |

The checker must cover: absolute drive-letter paths (use a negative lookahead to exclude `http://` and avoid false positives), user directories, build directories, source directory hierarchies, internal workspace directories, real version strings, usernames, and sample script names.

### 8.4 Pre-Publish Checklist

- [ ] The `-a` command count matches the number of rows in the §2 table; new commands are automatically included in §4.
- [ ] Every command with `help_kind=none` has an explanation or source fallback (here: `grep`).
- [ ] All help blocks are still verbatim program output, with only the substitutions listed in §8.3 — no hand-edited options.
- [ ] The built-in commands section contains no environment variables, credentials, or internal addresses.
- [ ] The redaction checker reports `CLEAN`; search the whole document once more for drive-letter paths and version strings.
- [ ] Placeholders in the §6 templates match the main text, and examples contain no real local paths.
- [ ] Temporary capture processes have exited and listening ports have been released.

---

This document is generated automatically from the running binary by the generator described above; **do not hand-edit the body**. To make changes, modify the collector/generator and re-run per §8.2.
