> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mirage.strukto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Core Tools

> Inspect, edit, search, and transform files with familiar command-line tools.

Unix commands over every mount. A mount's capabilities and the session's
permissions decide which ones run there.

Expand a command to see every flag it takes, read from the same grammar the
shell parses with; `man COMMAND` prints its manual. A familiar name does not
promise every option of the original program.

## Files and directories

**ls**

List entries.

**58 flags**

**-l**

**-b, --escape**

**-a, --all**

**-A, --almost-all**

**-h, --human-readable**

**-t**

**-S**

**-X**

**-v**

**-U**

**--sort \<text>**

**-c**

**-u**

**--time \<text>**

**--time-style \<text>**

**-r, --reverse**

**-1**

**-C**

**-x**

**-m**

**--format \<text>**

**-w, --width \<text>**

**-T, --tabsize \<text>**

**-s, --size**

**-k, --kibibytes**

**--si**

**-f**

**-I, --ignore \<text>**

**--hide \<text>**

**-B, --ignore-backups**

**-Q, --quote-name**

**-N, --literal**

**--quoting-style \<text>**

**-q, --hide-control-chars**

**--show-control-chars**

**--full-time**

**-G, --no-group**

**-R, --recursive**

**-d, --directory**

**-F, --classify\[=\<text>]**

**-p**

**--file-type**

**--indicator-style \<text>**

**-L, --dereference**

**-H, --dereference-command-line**

**--dereference-command-line-symlink-to-dir**

**-g**

**-o**

**-n, --numeric-uid-gid**

**-i, --inode**

**--color\[=\<text>]**

**--group-directories-first**

**--block-size \<text>**

**--hyperlink\[=\<text>]**

**-Z, --context**

**--zero**

**--author**

**-D, --dired**

**dir, vdir**

`ls` in columns or in long format, with names escaped.

**58 flags**

**-l**

**-b, --escape**

**-a, --all**

**-A, --almost-all**

**-h, --human-readable**

**-t**

**-S**

**-X**

**-v**

**-U**

**--sort \<text>**

**-c**

**-u**

**--time \<text>**

**--time-style \<text>**

**-r, --reverse**

**-1**

**-C**

**-x**

**-m**

**--format \<text>**

**-w, --width \<text>**

**-T, --tabsize \<text>**

**-s, --size**

**-k, --kibibytes**

**--si**

**-f**

**-I, --ignore \<text>**

**--hide \<text>**

**-B, --ignore-backups**

**-Q, --quote-name**

**-N, --literal**

**--quoting-style \<text>**

**-q, --hide-control-chars**

**--show-control-chars**

**--full-time**

**-G, --no-group**

**-R, --recursive**

**-d, --directory**

**-F, --classify\[=\<text>]**

**-p**

**--file-type**

**--indicator-style \<text>**

**-L, --dereference**

**-H, --dereference-command-line**

**--dereference-command-line-symlink-to-dir**

**-g**

**-o**

**-n, --numeric-uid-gid**

**-i, --inode**

**--color\[=\<text>]**

**--group-directories-first**

**--block-size \<text>**

**--hyperlink\[=\<text>]**

**-Z, --context**

**--zero**

**--author**

**-D, --dired**

**stat**

Show metadata.

**6 flags**

**-c, --format \<text>**

**--printf \<text>**

**-f, --file-system**

**-L, --dereference**

**-t, --terse**

**--cached \<text>**

**tree**

Show a directory tree.

**43 flags**

**-a**

**-L \<text>**

**-I \<text>**

**-d**

**-P \<text>**

**-x**

**-f**

**-i**

**-s**

**-D**

**-p**

**-F**

**-t**

**-v**

**-U**

**-r**

**-J**

**--dirsfirst**

**--noreport**

**--du**

**--prune**

**--gitignore**

**--filelimit \<text>**

**--sort \<text>**

**-C**

**-l**

**-n**

**-A**

**-Q**

**-N**

**-u**

**-g**

**-c**

**-o \<path>**

**-q**

**--filesfirst**

**--ignore-case**

**--matchdirs**

**--si**

**--timefmt \<text>**

**--charset \<text>**

**--inodes**

**--nolinks**

**du**

Count file and directory bytes.

**27 flags**

**-h, --human-readable**

**-s, --summarize**

**-a, --all**

**-d, --max-depth \<text>**

**-c, --total**

**-L, --dereference**

**-P, --no-dereference**

**-S, --separate-dirs**

**-x, --one-file-system**

**-b, --bytes**

**--apparent-size**

**-k**

**-m**

**-B, --block-size \<text>**

**--si**

**--inodes**

**-l, --count-links**

**-D, --dereference-args**

**-H**

**-0, --null**

**--exclude \<text>**

**-X, --exclude-from \<path>**

**--files0-from \<path>**

**-t \<text>**

**--threshold \<text>**

**--time\[=\<text>]**

**--time-style \<text>**

**df**

Show mount capacity, when available.

**8 flags**

**-h, --human-readable**

**-H, --si**

**-k**

**-i, --inodes**

**-a, --all**

**-T, --print-type**

**-P, --portability**

**-B, --block-size \<text>**

**mount**

List configured mounts. Mounting is refused, as for an unprivileged user: mounts come from the configuration. `-t` filters the list.

**12 flags**

**-a, --all**

Mount all filesystems mentioned in fstab.

**-f, --fake**

Dry run; skip the mount(2) syscall.

**-l, --show-labels**

Show also filesystem labels.

**-n, --no-mtab**

Don't write to /etc/mtab.

**-o, --options \<text>**

Comma-separated list of mount options.

**-r, --read-only**

Mount the filesystem read-only.

**-t, --types \<text>**

Limit the set of filesystem types.

**-v, --verbose**

Say what is being done.

**-w, --rw**

Mount the filesystem read-write (default).

**-B, --bind**

Mount a subtree somewhere else.

**-M, --move**

Move a subtree to some other place.

**-R, --rbind**

Mount a subtree and all submounts somewhere else.

**file**

Identify content type.

**4 flags**

**-b**

**-i**

**-L**

**-h**

**mkdir**

Create directories.

**4 flags**

**-p, --parents**

**-v, --verbose**

**-m, --mode \<text>**

**-Z, --context\[=\<text>]**

**touch**

Create files or update timestamps.

**9 flags**

**-a**

**-c, --no-create**

**-d, --date \<text>**

**-f**

**-h, --no-dereference**

**-m**

**-r, --reference \<path>**

**-t \<text>**

**--time \<text>**

**cp**

Copy files or directories, including across mounts.

**26 flags**

**--debug**

**-r, -R, --recursive**

**-a, --archive**

**-L, --dereference**

**-P, --no-dereference**

**-H**

**-d**

**-f, --force**

**-i, --interactive**

**-n, --no-clobber**

**-v, --verbose**

**-u, --update\[=\<text>]**

**-b, --backup\[=\<text>]**

**--strip-trailing-slashes**

**-t, --target-directory \<path>**

**-T, --no-target-directory**

**-S, --suffix \<text>**

**-x, --one-file-system**

**-p**

**--preserve\[=\<text>]**

**--no-preserve \<text>**

**--parents**

**-l, --link**

**-s, --symbolic-link**

**--remove-destination**

**--attributes-only**

**mv**

Move or rename entries.

**12 flags**

**-f, --force**

**-i, --interactive**

**-n, --no-clobber**

**-v, --verbose**

**-u, --update\[=\<text>]**

**-b, --backup\[=\<text>]**

**--strip-trailing-slashes**

**-t, --target-directory \<path>**

**--no-copy**

**--exchange**

**-T, --no-target-directory**

**-S, --suffix \<text>**

**rm**

Remove entries.

**9 flags**

**-r, -R, --recursive**

**-f, --force**

**-v, --verbose**

**-d, --dir**

**-i**

**-I**

**--preserve-root**

**--no-preserve-root**

**--one-file-system**

**rmdir**

Remove empty directories.

**3 flags**

**--ignore-fail-on-non-empty**

**-p, --parents**

**-v, --verbose**

**unlink**

Remove one entry.

**truncate**

Resize a file.

**4 flags**

**-c, --no-create**

**-s, --size \<text>**

**-o, --io-blocks**

**-r, --reference \<path>**

**mktemp**

Create a temporary file or directory.

**7 flags**

**-d, --directory**

**-p \<path>**

**--tmpdir\[=\<path>]**

**-t**

**-u, --dry-run**

**-q, --quiet**

**--suffix \<text>**

**ln**

Create a symbolic link or copy a file's bytes.

**13 flags**

**-S, --suffix \<text>**

**-f, --force**

**-n, --no-dereference**

**-v, --verbose**

**-r, --relative**

**-L, --logical**

**-P, --physical**

**-d, --directory**

**-F**

**-b, --backup\[=\<text>]**

**-s, --symbolic**

**-t, --target-directory \<path>**

**-T, --no-target-directory**

**link**

Copy a file's bytes to a new name.

**pathchk**

Check that names are valid or portable.

**3 flags**

**-p**

**-P**

**--portability**

**readlink**

Read a link or resolve its target.

**8 flags**

**-f, --canonicalize**

**-e, --canonicalize-existing**

**-m, --canonicalize-missing**

**-n, --no-newline**

**-q, --quiet**

**-s, --silent**

**-v, --verbose**

**-z, --zero**

**realpath**

Resolve a path.

**10 flags**

**-e, --canonicalize-existing**

**-m, --canonicalize-missing**

**-L, --logical**

**-P, --physical**

**-q, --quiet**

**--relative-to \<text>**

**--relative-base \<text>**

**-s, --strip**

**--no-symlinks**

**-z, --zero**

**basename**

Remove a directory prefix or suffix.

**3 flags**

**-a, --multiple**

**-s, --suffix \<text>**

**-z, --zero**

**dirname**

Print the parent path.

**1 flag**

**-z, --zero**

**chmod**

Set permission metadata.

**11 flags**

**-c, --changes**

**-f, --silent**

**--quiet**

**-v, --verbose**

**-R, --recursive**

**--reference \<path>**

**--preserve-root**

**--no-preserve-root**

**-H**

**-L**

**-P**

**chown**

Set owner or group metadata.

**14 flags**

**-c, --changes**

**-f, --silent**

**--quiet**

**-v, --verbose**

**--dereference**

**-h, --no-dereference**

**-R, --recursive**

**--reference \<path>**

**--preserve-root**

**--no-preserve-root**

**-H**

**-L**

**-P**

**--from \<text>**

**chgrp**

Set owner or group metadata.

**13 flags**

**-c, --changes**

**-f, --silent**

**--quiet**

**-v, --verbose**

**--dereference**

**-h, --no-dereference**

**-R, --recursive**

**--reference \<path>**

**--preserve-root**

**--no-preserve-root**

**-H**

**-L**

**-P**

**getfattr**

Read extended attributes.

**11 flags**

**-n, --name \<text>**

Get the named extended attribute value.

**-d, --dump**

Get all extended attribute values.

**-e, --encoding \<text>**

Encode values (as 'text', 'hex' or 'base64').

**-m, --match \<text>**

Only get attributes with names matching pattern.

**--only-values**

Print the bare values only.

**-h, --no-dereference**

Do not dereference symbolic links.

**--absolute-names**

Don't strip leading '/' in pathnames.

**-R, --recursive**

Recurse into subdirectories.

**-L, --logical**

Logical walk, follow symbolic links.

**-P, --physical**

Physical walk, do not follow symbolic links.

**--one-file-system**

Stay on the mount each path starts on.

**setfattr**

Set or remove an extended attribute.

**6 flags**

**-n, --name \<text>**

Set the value of the named extended attribute.

**-x, --remove \<text>**

Remove the named extended attribute.

**-v, --value \<text>**

Use value as the attribute value.

**-h, --no-dereference**

Do not dereference symbolic links.

**--raw**

Store each value exactly as typed, undecoded.

**--restore \<text>**

Set the attributes a getfattr --dump listing names.

## Search and compare

**find**

Select paths and run actions.

**77 flags**

**-name \<text>**

**-type \<text>**

**-maxdepth \<text>**

**-size \<text>**

**-mtime \<text>**

**-iname \<text>**

**-path \<text>**

**-mindepth \<text>**

**-printf \<text>**

**-newer \<text>**

**-newermt \<text>**

**-anewer \<text>**

**-cnewer \<text>**

**-inum \<text>**

**-used \<text>**

**-fstype \<text>**

**-fls \<text>**

**-ipath \<text>**

**-wholename \<text>**

**-iwholename \<text>**

**-regex \<text>**

**-iregex \<text>**

**-regextype \<text>**

**-lname \<text>**

**-ilname \<text>**

**-xtype \<text>**

**-perm \<text>**

**-links \<text>**

**-atime \<text>**

**-ctime \<text>**

**-mmin \<text>**

**-amin \<text>**

**-cmin \<text>**

**-user \<text>**

**-group \<text>**

**-uid \<text>**

**-gid \<text>**

**-fprint \<text>**

**-fprint0 \<text>**

**-fprintf \<text> \<text>**

**-files0-from \<text>**

**-P**

**-H**

**-L**

**-print**

**-print0**

**-delete**

**-depth**

**-xdev**

**-noleaf**

**-warn**

**-nowarn**

**-ignore\_readdir\_race**

**-noignore\_readdir\_race**

**-mount**

**-prune**

**-ls**

**-empty**

**-quit**

**-true**

**-false**

**-readable**

**-writable**

**-executable**

**-nouser**

**-nogroup**

**-daystart**

**-follow**

**-o**

**-or**

**-a**

**-and**

**-not**

**-exec \<command> ;**

Run a command on each path, `&#123;&#125;` standing for it.

**-exec \<command> \{} +**

Run a command once on many paths.

**-execdir \<command> ;**

Run a command from each path's directory.

**-execdir \<command> \{} +**

Run a command once per directory.

**grep**

Search lines.

**48 flags**

**-r, --recursive**

**-R, --dereference-recursive**

**-d, --directories \<text>**

**-D, --devices \<text>**

**-i, -y, --ignore-case**

**--no-ignore-case**

**-I**

**-v, --invert-match**

**-n, --line-number**

**--binary-files \<text>**

**-c, --count**

**-l, --files-with-matches**

**-L, --files-without-match**

**-w, --word-regexp**

**-x, --line-regexp**

**-F, --fixed-strings, --fixed-regexp**

**-E, --extended-regexp**

**-G, --basic-regexp**

**-P, --perl-regexp**

**-z, --null-data**

**-o, --only-matching**

**-q, --quiet, --silent**

**-s, --no-messages**

**-H, --with-filename**

**-h, --no-filename**

**--label \<text>**

**-Z, --null**

**-T, --initial-tab**

**-m, --max-count \<text>**

**-A, --after-context \<text>**

**-B, --before-context \<text>**

**-C, --context \<text>**

**--group-separator \<text>**

**--no-group-separator**

**-e, --regexp \<text>**

**-f, --file \<path>**

**-a, --text**

**-b, --byte-offset**

**--include \<text>**

**--exclude \<text>**

**--exclude-from \<path>**

**--exclude-dir \<text>**

**-V**

**--color\[=\<text>]**

**--colour\[=\<text>]**

**--line-buffered**

**-U, --binary**

**-u, --unix-byte-offsets**

**rg**

Search recursively with path filters.

**146 flags**

**-e, --regexp \<text>**

**-f, --file \<path>**

**-i, --ignore-case**

**-s, --case-sensitive**

**-S, --smart-case**

**-v, --invert-match**

**--no-invert-match**

**-w, --word-regexp**

**-x, --line-regexp**

**-F, --fixed-strings**

**--no-fixed-strings**

**-m, --max-count \<text>**

**--stop-on-nonmatch**

**-n, --line-number**

**-N, --no-line-number**

**-b, --byte-offset**

**--no-byte-offset**

**--column**

**--no-column**

**--vimgrep**

**-o, --only-matching**

**-r, --replace \<text>**

**--trim**

**--no-trim**

**-M, --max-columns \<text>**

**--max-columns-preview**

**--no-max-columns-preview**

**-0, --null**

**--null-data**

**--path-separator \<text>**

**-q, --quiet**

**-c, --count**

**--count-matches**

**--include-zero**

**--no-include-zero**

**-l, --files-with-matches**

**--files-without-match**

**--files**

**--type-list**

**-H, --with-filename**

**-I, --no-filename**

**--heading**

**--no-heading**

**-A, --after-context \<text>**

**-B, --before-context \<text>**

**-C, --context \<text>**

**--passthru**

**--passthrough**

**--context-separator \<text>**

**--no-context-separator**

**--field-match-separator \<text>**

**--field-context-separator \<text>**

**-g, --glob \<text>**

**--iglob \<text>**

**--glob-case-insensitive**

**--no-glob-case-insensitive**

**-t, --type \<text>**

**-T, --type-not \<text>**

**--type-add \<text>**

**--type-clear \<text>**

**-., --hidden**

**--no-hidden**

**-u, --unrestricted**

**-d, --max-depth, --maxdepth \<text>**

**--max-filesize \<text>**

**-L, --follow**

**--one-file-system**

**--no-one-file-system**

**-a, --text**

**--no-text**

**--binary**

**--no-binary**

**--sort \<text>**

**--sortr \<text>**

**--sort-files**

**--no-sort-files**

**--no-messages**

**--messages**

**--no-ignore**

**--ignore**

**--no-ignore-dot**

**--ignore-dot**

**--no-ignore-exclude**

**--ignore-exclude**

**--ignore-file \<path>**

**--no-ignore-files**

**--ignore-files**

**--no-ignore-global**

**--ignore-global**

**--no-ignore-messages**

**--ignore-messages**

**--no-ignore-parent**

**--ignore-parent**

**--no-ignore-vcs**

**--ignore-vcs**

**--no-require-git**

**--require-git**

**--ignore-file-case-insensitive**

**--no-ignore-file-case-insensitive**

**--no-config**

**-j, --threads \<text>**

**--line-buffered**

**--no-line-buffered**

**--block-buffered**

**--no-block-buffered**

**--mmap**

**--no-mmap**

**--no-follow**

**--stats**

**--no-stats**

**--json**

**--crlf**

**--no-crlf**

**-U, --multiline**

**--no-multiline**

**--multiline-dotall**

**--no-multiline-dotall**

**-P, --pcre2**

**--no-pcre2**

**--engine \<text>**

**--no-json**

**-z, --search-zip**

**--no-search-zip**

**-E, --encoding \<text>**

**--no-encoding**

**--pre \<text>**

**--pre-glob \<text>**

**--no-pre**

**--unicode**

**--no-unicode**

**--pcre2-unicode**

**--no-pcre2-unicode**

**--auto-hybrid-regex**

**--no-auto-hybrid-regex**

**--color \<text>**

**-p, --pretty**

**--colors \<text>**

**--hyperlink-format \<text>**

**--hostname-bin \<text>**

**--dfa-size-limit \<text>**

**--regex-size-limit \<text>**

**--debug**

**--trace**

**-h**

**-V**

**--pcre2-version**

**fd**

Find entries by name under ignore rules.

**30 flags**

**-H, --hidden**

**-I, --no-ignore**

**--no-ignore-vcs**

**--no-ignore-parent**

**--no-require-git**

**-u, --unrestricted**

**-s, --case-sensitive**

**-i, --ignore-case**

**-g, --glob**

**--regex**

**-F, --fixed-strings**

**-a, --absolute-path**

**-L, --follow**

**-p, --full-path**

**-0, --print0**

**-d, --max-depth \<depth>**

**--min-depth \<depth>**

**--exact-depth \<depth>**

**-E, --exclude \<pattern>**

**-t, --type \<filetype>**

**-e, --extension \<ext>**

**-x, --exec \<cmd>**

**-X, --exec-batch \<cmd>**

**--ignore-file \<path>**

**-c, --color \<when>**

**-j, --threads \<num>**

**--max-results \<count>**

**-1**

**-q, --quiet**

**--strip-cwd-prefix\[=\<when>]**

**search**

Search through a backend's search capability.

**3 flags**

**--method \<text>**

Ranking method: semantic (default); Dify also takes fulltext, hybrid and keyword.

**--top-k \<text>**

Most hits to print; the mount's default when absent.

**--threshold \<text>**

Lowest score a hit needs, or on LanceDB the largest distance it may have; 0 keeps every hit.

**diff**

Compare text files or directory trees.

**38 flags**

**-i, --ignore-case**

**-w, --ignore-all-space**

**-b, --ignore-space-change**

**-E, --ignore-tab-expansion**

**-Z, --ignore-trailing-space**

**-B, --ignore-blank-lines**

**-I, --ignore-matching-lines \<text>**

**--strip-trailing-cr**

**--speed-large-files**

**--horizon-lines \<text>**

**-a, --text**

**--normal**

**-e, --ed**

**-n, --rcs**

**-c**

**-C \<text>**

**--context\[=\<text>]**

**-u**

**-U \<text>**

**--unified\[=\<text>]**

**-y, --side-by-side**

**-W, --width \<text>**

**--left-column**

**--suppress-common-lines**

**-p, --show-c-function**

**-F, --show-function-line \<text>**

**-t, --expand-tabs**

**-T, --initial-tab**

**-L, --label \<text>**

**--color\[=\<text>]**

**-q, --brief**

**-r, --recursive**

**-N, --new-file**

**--unidirectional-new-file**

**--no-dereference**

**-x, --exclude \<text>**

**-X, --exclude-from \<path>**

**-s, --report-identical-files**

**cmp**

Compare bytes.

**6 flags**

**-l, --verbose**

**-s, --quiet**

**--silent**

**-n, --bytes \<text>**

**-b, --print-bytes**

**-i, --ignore-initial \<text>**

**patch**

Apply a patch.

**20 flags**

**-p \<text>**

**-R**

**-i \<path>**

**-N**

**-d, --directory \<text>**

**--dry-run**

**-b, --backup**

**-z, --suffix \<text>**

**-B, --prefix \<text>**

**-V, --version-control \<text>**

**-o, --output \<text>**

**-r, --reject-file \<text>**

**-s, --silent, --quiet**

**-f, --force**

**-t, --batch**

**-l, --ignore-whitespace**

**-F, --fuzz \<text>**

**-E, --remove-empty-files**

**-u, --unified**

**--verbose**

**look**

Find lines with a prefix.

**3 flags**

**-f, --ignore-case**

**-d, --alphanum**

**-t, --terminate \<text>**

`egrep`, `fgrep` and `rgrep` invoke `grep` with `-E`, `-F` and `-r` respectively. `zcmp` and `zdiff` compare gzip files with `cmp` and `diff`. Compressed-file search is covered under [Data & Network](https://docs.mirage.strukto.ai/home/core/data.md#archives-and-compression).

## Text processing

**cat**

Read and concatenate files.

**10 flags**

**-b, --number-nonblank**

**-n, --number**

**-s, --squeeze-blank**

**-v, --show-nonprinting**

**-E, --show-ends**

**-e**

**-t**

**-T, --show-tabs**

**-A, --show-all**

**-u**

**head**

Read the beginning.

**6 flags**

**-n, --lines \<text>**

**-c, --bytes \<text>**

**-q, --quiet**

**--silent**

**-v, --verbose**

**-z, --zero-terminated**

**tail**

Read the end or follow changes.

**12 flags**

**-n, --lines \<text>**

**-c, --bytes \<text>**

**-q, --quiet**

**--silent**

**-v, --verbose**

**-z, --zero-terminated**

**-f, --follow\[=\<text>]**

**-F**

**--retry**

**-s, --sleep-interval \<text>**

**--pid \<text>**

**--max-unchanged-stats \<text>**

**wc**

Count lines, words, bytes, or characters.

**7 flags**

**-l, --lines**

**-w, --words**

**-c, --bytes**

**-m, --chars**

**-L, --max-line-length**

**--total \<text>**

**--files0-from \<path>**

**sort**

Order lines.

**25 flags**

**-r, --reverse**

**-n, --numeric-sort**

**-u, --unique**

**-b, --ignore-leading-blanks**

**-k, --key \<text>**

**-t, --field-separator \<text>**

**-h, --human-numeric-sort**

**-V, --version-sort**

**-s, --stable**

**-m, --merge**

**-f, --ignore-case**

**-c**

**-C**

**--check\[=\<text>]**

**-d, --dictionary-order**

**-g, --general-numeric-sort**

**-i, --ignore-nonprinting**

**-M, --month-sort**

**-o, --output \<path>**

**-z, --zero-terminated**

**-R, --random-sort**

**--random-source \<path>**

**--files0-from \<path>**

**--batch-size \<text>**

**--compress-program \<text>**

**uniq**

Filter adjacent repeated lines.

**11 flags**

**-c, --count**

**-d, --repeated**

**-D**

**--all-repeated\[=\<text>]**

**--group\[=\<text>]**

**-u, --unique**

**-f, --skip-fields \<text>**

**-s, --skip-chars \<text>**

**-i, --ignore-case**

**-w, --check-chars \<text>**

**-z, --zero-terminated**

**cut**

Select fields, bytes, or characters.

**13 flags**

**-f, --fields \<text>**

**-F \<text>**

**-d, --delimiter \<text>**

**-c, --characters \<text>**

**-b, --bytes \<text>**

**-n, --no-partial**

**--complement**

**-s, --only-delimited**

**-O \<text>**

**--output-delimiter \<text>**

**-w**

**--whitespace-delimited\[=\<text>]**

**-z, --zero-terminated**

**tr**

Translate, delete, or squeeze characters.

**5 flags**

**-d, --delete**

**-s, --squeeze-repeats**

**-c, --complement**

**-C**

**-t, --truncate-set1**

**sed**

Edit a text stream.

**14 flags**

**-i\[\<SUFFIX>], --in-place\[=\<SUFFIX>]**

Rewrite each file; -iSUFFIX keeps a backup.

**-e, --expression \<SCRIPT>**

One piece of the script, joined in order.

**-f, --file \<FILE>**

Read a piece of the script from FILE.

**--follow-symlinks**

With -i, rewrite what a link points to.

**-n, --quiet, --silent**

Print only what the script prints.

**--debug**

Show the program and trace each command.

**-E, -r, --regexp-extended**

Read regular expressions as ERE.

**-l, --line-length \<N>**

Wrap l output at N chars; 0 never wraps.

**--posix**

Refuse what POSIX sed does not have.

**--sandbox**

Refuse running programs and opening files.

**-s, --separate**

Number lines and match \$ per file.

**-u, --unbuffered**

Read only as far as each line needs.

**-z, --null-data, --zero-terminated**

Lines end at NUL, not newline.

**-b, --binary**

Accepted; input is always raw bytes.

**awk**

Process records and fields.

**3 flags**

**-F \<text>**

**-v \<text>**

**-f \<path>**

**tee**

Copy stdin to stdout and files.

**4 flags**

**-a, --append**

**-i, --ignore-interrupts**

**-p**

**--output-error\[=\<text>]**

**paste**

Combine lines into columns.

**3 flags**

**-d, --delimiters \<text>**

**-s, --serial**

**-z, --zero-terminated**

**join**

Join sorted files on a field.

**13 flags**

**-t \<text>**

**-1 \<text>**

**-2 \<text>**

**-a \<text>**

**-v \<text>**

**-e \<text>**

**-o \<text>**

**-i, --ignore-case**

**-j \<text>**

**-z, --zero-terminated**

**--check-order**

**--nocheck-order**

**--header**

**comm**

Compare sorted lines.

**8 flags**

**-1**

**-2**

**-3**

**--check-order**

**--nocheck-order**

**--output-delimiter \<text>**

**--total**

**-z, --zero-terminated**

**split**

Split input into files.

**12 flags**

**-l, --lines \<text>**

**-b, --bytes \<text>**

**-C, --line-bytes \<text>**

**-n, --number \<text>**

**-e, --elide-empty-files**

**-u, --unbuffered**

**--verbose**

**-d, --numeric-suffixes\[=\<text>]**

**-x, --hex-suffixes\[=\<text>]**

**-a, --suffix-length \<text>**

**--additional-suffix \<text>**

**-t, --separator \<text>**

**csplit**

Split at line numbers or patterns.

**8 flags**

**-f, --prefix \<path>**

**-n, --digits \<text>**

**--silent**

**-k, --keep-files**

**-s, --quiet**

**-b, --suffix-format \<text>**

**--suppress-matched**

**-z, --elide-empty-files**

**nl**

Number lines.

**11 flags**

**-b, --body-numbering \<text>**

**-v, --starting-line-number \<text>**

**-f, --footer-numbering \<text>**

**-h, --header-numbering \<text>**

**-l, --join-blank-lines \<text>**

**-p, --no-renumber**

**-s, --number-separator \<text>**

**-d, --section-delimiter \<text>**

**-i, --line-increment \<text>**

**-w, --number-width \<text>**

**-n, --number-format \<text>**

**tac**

Reverse record order.

**3 flags**

**-b, --before**

**-r, --regex**

**-s, --separator \<text>**

**rev**

Reverse characters in each line.

**1 flag**

**-0, --zero**

**column**

Arrange text into columns.

**19 flags**

**-t, --table**

**-s, --separator \<text>**

**-o, --output-separator \<text>**

**-c, --output-width \<text>**

**-x, --fillrows**

**-J, --json**

**-n, --table-name \<text>**

**-N, --table-columns \<text>**

**-C, --table-column \<text>**

**-O, --table-order \<text>**

**-l, --table-columns-limit \<text>**

**-R, --table-right \<text>**

**-H, --table-hide \<text>**

**-T, --table-truncate \<text>**

**-W, --table-wrap \<text>**

**-E, --table-noextreme \<text>**

**-d, --table-noheadings**

**-m, --table-maxout**

**-e, --table-header-repeat**

**fold**

Wrap long lines.

**4 flags**

**-w, --width \<text>**

**-s, --spaces**

**-b, --bytes**

**-c, --characters**

**fmt**

Reflow paragraphs.

**7 flags**

**-w, --width \<text>**

**-g, --goal \<text>**

**-c, --crown-margin**

**-p, --prefix \<text>**

**-s, --split-only**

**-t, --tagged-paragraph**

**-u, --uniform-spacing**

**expand**

Convert tabs and spaces.

**2 flags**

**-t, --tabs \<text>**

**-i, --initial**

**unexpand**

Convert tabs and spaces.

**3 flags**

**-t, --tabs \<text>**

**-a, --all**

**--first-only**

**strings**

Extract printable strings.

**10 flags**

**-a, --all**

Read the whole file (always so).

**-d, --data**

Read the data sections (the whole file here).

**-f, --print-file-name**

Name the file before each string.

**-n, --bytes \<text>**

The fewest characters a string has (4).

**-t, --radix \<text>**

Print each offset in base o, d or x.

**-o**

The same as -t o.

**-w, --include-all-whitespace**

Let any whitespace belong to a string.

**-T, --target \<text>**

The object format (ignored: every file is bytes).

**-e, --encoding \<text>**

Character width and order: s, S, b, l, B or L.

**-s, --output-separator \<text>**

What follows each string instead of a newline.

**seq**

Generate a number sequence.

**3 flags**

**-s, --separator \<text>**

Use the given string as separator between numbers.

**-w, --equal-width**

Pad numbers with zeros to equal width.

**-f, --format \<text>**

Format each number with a printf-style format string.

**shuf**

Shuffle or sample lines.

**7 flags**

**-n, --head-count \<text>**

**-e, --echo**

**-z, --zero-terminated**

**-r, --repeat**

**-i, --input-range \<text>**

**-o, --output \<path>**

**--random-source \<path>**

**tsort**

Sort dependency pairs.

**colrm**

Remove columns from each line.

**envsubst**

Fill environment variables into text.

**1 flag**

**-v, --variables**

**yes**

Repeat a line until the reader stops.

**numfmt**

Convert numeric units.

**14 flags**

**--to \<text>**

**--from \<text>**

**--from-unit \<text>**

**--to-unit \<text>**

**--round \<text>**

**--suffix \<text>**

**--padding \<text>**

**--format \<text>**

**--invalid \<text>**

**--grouping**

**-d, --delimiter \<text>**

**--field \<text>**

**--header\[=\<text>]**

**-z, --zero-terminated**

## Running commands and inspecting the environment

**xargs**

Build commands from input.

**21 flags**

**-0, --null**

Input items are terminated by NUL.

**-a, --arg-file \<text>**

Read items from this file, not standard input.

**-d, --delimiter \<text>**

Input items are separated by this character.

**-E \<text>**

Stop reading at this logical end-of-file string.

**-e\[\<text>], --eof\[=\<text>]**

Same as -E; no string turns it off.

**-I \<text>**

Replace this string in the initial arguments with each input line.

**-i\[\<text>], --replace\[=\<text>]**

Same as -I, with \{} when no string is attached.

**-L \<text>**

Use at most N non-blank input lines per command line.

**-l\[\<text>], --max-lines\[=\<text>]**

Same as -L, with 1 when no count is attached.

**-n, --max-args \<text>**

Use at most N arguments per command line.

**-o, --open-tty**

Reopen stdin as the terminal in each command (there is no terminal, so this fails).

**-p, --interactive**

Prompt before running each command (there is no terminal, so this fails).

**-r, --no-run-if-empty**

Do not run the command on empty input.

**-s, --max-chars \<text>**

Limit a command line to N bytes.

**-t, --verbose**

Print each command on stderr before running it.

**--show-limits**

Show the command-line length limits.

**-x, --exit**

Exit if a command line exceeds the size limit.

**-P, --max-procs \<text>**

Run up to N commands at a time; 0 runs them all at once.

**--process-slot-var \<text>**

Set this variable to each command's slot number.

**--version**

Show version information and exit.

**--help**

Show this help and exit.

**timeout**

Limit a command's running time.

**7 flags**

**-f, --foreground**

Signal only the command, not its process group.

**-k, --kill-after \<text>**

Also send KILL this long after the first signal.

**-p, --preserve-status**

Exit with the command's status even when it times out.

**-s, --signal \<text>**

Signal to send on timeout (default TERM).

**-v, --verbose**

Report each signal sent on stderr.

**--help**

Show this help and exit.

**--version**

Show version information and exit.

**nohup**

Run a command with no change to how it runs here.

**nice**

Run a command with no change to how it runs here.

**1 flag**

**-n, --adjustment \<text>**

**stdbuf**

Run a command with no change to how it runs here.

**3 flags**

**-i, --input \<text>**

**-o, --output \<text>**

**-e, --error \<text>**

**setsid**

Run a command with no change to how it runs here.

**3 flags**

**-c, --ctty**

**-f, --fork**

**-w, --wait**

**sleep**

Wait for a duration.

**env**

Run with environment changes or print exported variables.
Options: `-i`, `-u NAME`, `NAME=VALUE`.

**printenv**

Run with environment changes or print exported variables.
Options: `NAME`.

**date**

Format a date or time.

**9 flags**

**-d, --date \<text>**

Display the time described by the given date string.

**-I\[\<text>], --iso-8601\[=\<text>]**

Output date/time in ISO 8601 format, to the given precision (default date).

**-R, --rfc-email**

Output date in RFC 5322 email format.

**--rfc-3339 \<text>**

Output date/time in RFC 3339 format, to the given precision.

**-u, --utc**

Use Coordinated Universal Time (UTC).

**--universal**

Use Coordinated Universal Time (UTC).

**-r, --reference \<path>**

Display the time the given file was last modified.

**-f, --file \<path>**

Display the time each line of the given file describes, as -d would.

**--resolution**

Display the resolution of the times shown.

**uname**

Report system or host information.

**9 flags**

**-a, --all**

Print all information, omitting -p and -i if unknown.

**-s, --kernel-name**

Print the kernel name.

**-n, --nodename**

Print the network node hostname.

**-r, --kernel-release**

Print the kernel release.

**-v, --kernel-version**

Print the kernel version.

**-m, --machine**

Print the machine hardware name.

**-p, --processor**

Print the processor type.

**-i, --hardware-platform**

Print the hardware platform.

**-o, --operating-system**

Print the operating system.

**hostname**

Report system or host information.

**13 flags**

**-a, --alias**

Alias names.

**-A, --all-fqdns**

All long host names (FQDNs).

**-b, --boot**

Set default hostname if none available.

**-d, --domain**

DNS domain name.

**-f, --fqdn**

Long host name (FQDN).

**--long**

Long host name (FQDN).

**-F, --file \<text>**

Read host name or NIS domain name from given file.

**-i, --ip-address**

Addresses for the host name.

**-I, --all-ip-addresses**

All addresses for the host.

**-s, --short**

Short host name.

**-y, --yp**

NIS/YP domain name.

**--nis**

NIS/YP domain name.

**--machine \<text>**

Answer for this machine only.

**arch**

Report system or host information.

**hostid**

Report system or host information.

**nproc**

Report system or host information.

**3 flags**

**--all**

**--ignore \<text>**

**--machine \<text>**

Answer for this machine only.

**id**

Report identity: a session with no profile is root, one with a profile is that profile's user, and nobody logs in.

**8 flags**

**-a**

Ignore, for compatibility with other versions.

**-Z, --context**

Print only the security context of the process.

**-g, --group**

Print only the effective group ID.

**-G, --groups**

Print all group IDs.

**-n, --name**

Print a name instead of a number, for -u,-g,-G.

**-r, --real**

Print the real ID instead of the effective ID, with -u,-g,-G.

**-u, --user**

Print only the effective user ID.

**-z, --zero**

Delimit entries with NUL characters, not whitespace; not permitted in default format.

**whoami**

Report identity: a session with no profile is root, one with a profile is that profile's user, and nobody logs in.
Options: No options.

**groups**

Report identity: a session with no profile is root, one with a profile is that profile's user, and nobody logs in.

**logname**

Report identity: a session with no profile is root, one with a profile is that profile's user, and nobody logs in.

**users**

Report identity: a session with no profile is root, one with a profile is that profile's user, and nobody logs in.

**who**

Report identity: a session with no profile is root, one with a profile is that profile's user, and nobody logs in.

**14 flags**

**-a, --all**

**-b, --boot**

**-d, --dead**

**-H, --heading**

**-l, --login**

**--lookup**

**-m**

**-p, --process**

**-q, --count**

**-r, --runlevel**

**-s, --short**

**-t, --time**

**-T, -w, --mesg, --message, --writable**

**-u, --users**

**tty**

Report that there is no terminal, or check that files exist.

**1 flag**

**-s, --silent, --quiet**

**sync**

Report that there is no terminal, or check that files exist.

**2 flags**

**-d, --data**

**-f, --file-system**

**getconf**

Query configuration values.

**2 flags**

**-a**

Print every variable and its value.

**-v \<text>**

Give values for compilation environment SPEC.

`python3`, `node` and `js` run on a [machine](https://docs.mirage.strukto.ai/home/setup/machine/overview.md),
through a [runtime](https://docs.mirage.strukto.ai/home/setup/runtime/overview.md) or a program installed there.

## Limits

* `rm -i` and `-I` are accepted but ignored; deletion does not prompt for confirmation.
* File operations depend on the backend; a read-only mount cannot accept writes. Permission and owner metadata may live in Mirage's overlay rather than the remote service.
* Mount roots are protected from removal, renaming, and use as copy sources. `mount` lists configured mounts; it does not attach new backends.
* `ln -s` creates a virtual symlink. Without `-s`, a regular file is copied; there is no shared hard-link inode.
* `find` supports `-a`, `-o`, `!`, parentheses, and both `-exec ... \;` and `-exec ... {} +`. Tests must precede actions in each AND chain, and OR branches must use the same action. `-newer` and `-newermt` must be in a top-level AND chain. `-ok` and `-okdir` are unsupported.
* `rg` cannot sort by creation time. `ls --color` and `grep --color` are accepted without colored output.
* Under a UTF-8 locale (`LANG=C.UTF-8`), `find` names a file or a value between `‘` and `’`, as Linux's does. Other commands keep straight quotes in their messages.
* Under a UTF-8 locale, `sed`, `grep`, `expr`, `nl`, `[[ =~ ]]` and `git`'s filters match whole characters. A pattern byte that is only part of one, such as `\xa9` against `é` (bytes `C3 A9`), matches nothing there, where Linux's `sed` can match it inside the character.
* In rare patterns, `sed`, `expr` and `[[ =~ ]]` capture different text in a group than Linux does, or find a match where Linux finds none. Such a pattern repeats a group that holds an anchor (`^`, `$`, `\b`, `\<`, `\>`) or can match nothing, or refers back to one. For example, `[[ ab =~ (a|b|$){1,3} ]]` leaves `BASH_REMATCH[1]` empty where Linux sets it to `b`, and `echo babc | sed 's/\(\<[a-][ab]\|[a-c]\)\{2\}/<&>/'` prints `<ba>bc` where Linux prints `babc`.
* `getconf -a` lists the same variables and values as Linux, in the order of POSIX's tables rather than the C library's.
* `xargs -p` and `-o` fail because there is no terminal. `timeout` signals its command as `kill` does, so a program can handle the signal; a Mirage command cannot trap one.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.