Command reference
Every fx- command, generated from its Dhall schema. The schema is the single source of truth: the same declaration produces the POSIX parser, the typed Dhall-record form, and this page.
See the README for how to add a command, or concept.md for the design.
fx-basenamestrip directories and any suffix from file names
usage: fx-basename [OPTIONS] [NAME] [SUFFIX]
| field | type | default | flag / operand |
|---|---|---|---|
all | Bool | False | -a, --multiple |
input | Text | "" | NAME |
names | List Text | [] | — |
suffix | Text | "" | SUFFIX |
fx-catconcatenate FILEs (or stdin) to stdout, bytes to bytes
usage: fx-cat [FILE...]
| field | type | default | flag / operand |
|---|---|---|---|
files | List Text | [] | FILE … |
fx-chgrpchange the group ownership of files (datalog-backed stat rows)
usage: fx-chgrp [GROUP] [FILE...]
| field | type | default | flag / operand |
|---|---|---|---|
group | Text | "" | GROUP |
paths | List Text | [] | FILE … |
fx-chmodchange file mode bits, journaled through the derivation log
usage: fx-chmod [MODE] [FILE...]
| field | type | default | flag / operand |
|---|---|---|---|
mode | Text | "" | MODE |
paths | List Text | [] | FILE … |
fx-chownchange the owner and/or group of files (datalog-backed stat rows)
usage: fx-chown [OWNER] [FILE...]
| field | type | default | flag / operand |
|---|---|---|---|
owner | Text | "" | OWNER |
paths | List Text | [] | FILE … |
fx-cksumprint CRC checksum (POSIX) and byte count for each FILE
usage: fx-cksum [FILE...]
| field | type | default | flag / operand |
|---|---|---|---|
files | List Text | [] | FILE … |
fx-commcompare two sorted files line by line (three-column output)
usage: fx-comm [OPTIONS] [FILE1] [FILE2]
| field | type | default | flag / operand |
|---|---|---|---|
a | Text | "" | FILE1 |
b | Text | "" | FILE2 |
one | Bool | False | -1, --suppress-1 |
three | Bool | False | -3, --suppress-3 |
two | Bool | False | -2, --suppress-2 |
fx-cpcopy files, capturing originals to CAS before mutating
usage: fx-cp [SRC] [DST]
| field | type | default | flag / operand |
|---|---|---|---|
dst | Text | "" | DST |
src | Text | "" | SRC |
fx-dateprint or set the system date and time (UTC)
usage: fx-date [OPTIONS]
| field | type | default | flag / operand |
|---|---|---|---|
format | Text | "%a %b %e %H:%M:%S %Z %Y" | — |
utc | Bool | False | -u, --utc |
fx-dfreport filesystem usage in 1K blocks via statvfs
usage: fx-df [OPTIONS] [PATH]
| field | type | default | flag / operand |
|---|---|---|---|
path | Text | "" | PATH |
rows | Bool | False | --rows |
fx-diffcompare two files (or trees, -r) line by line
usage: fx-diff [OPTIONS] [A] [B]
| field | type | default | flag / operand |
|---|---|---|---|
a | Text | "" | A |
b | Text | "" | B |
recursive | Bool | False | -r, --recursive |
fx-dirnamestrip the last component from a file name
usage: fx-dirname [NAME...]
| field | type | default | flag / operand |
|---|---|---|---|
names | List Text | [] | NAME … |
fx-duestimate file space usage as Datalog-backed stat rows
usage: fx-du [OPTIONS] [PATH]
| field | type | default | flag / operand |
|---|---|---|---|
maxdepth | Optional Natural | None | -d, --max-depth N |
path | Text | "." | PATH |
rows | Bool | False | --rows |
summary | Bool | False | -s, --summarize |
fx-echoprint the given STRINGs to stdout, newline-terminated
usage: fx-echo [OPTIONS] [STRING...]
| field | type | default | flag / operand |
|---|---|---|---|
escapes | Bool | False | -e |
no_newline | Bool | False | -n |
strings | List Text | [] | STRING … |
fx-envprint, filter or modify the environment, then run nothing (print form)
usage: fx-env [OPTIONS] [NAME=VALUE...]
| field | type | default | flag / operand |
|---|---|---|---|
ignore | Bool | False | -i, --ignore-environment |
sets | List Text | [] | NAME=VALUE … |
unset | Optional Text | None | -u, --unset TEXT |
fx-expandconvert tabs in FILEs (or stdin) to spaces
usage: fx-expand [OPTIONS] [FILE...]
| field | type | default | flag / operand |
|---|---|---|---|
files | List Text | [] | FILE … |
tabstop | Natural | 8 | -t, --tabs N |
fx-findwalk a directory closure via Datalog reachability from ROOT
usage: fx-find [ROOT]
| field | type | default | flag / operand |
|---|---|---|---|
maxdepth | Optional Natural | None | — |
name_glob | Optional Text | None | — |
root | Text | "." | ROOT |
type_filter | Optional < Dir | File > | None | — |
fx-grepprint lines of files under ROOT matching a regex PATTERN
usage: fx-grep [PATTERN] [ROOT]
| field | type | default | flag / operand |
|---|---|---|---|
maxdepth | Optional Natural | None | — |
name_glob | Optional Text | None | — |
pattern | Text | "" | PATTERN |
root | Text | "." | ROOT |
fx-headprint the first N lines (-n, default 10) of FILEs (or stdin)
usage: fx-head [OPTIONS] [FILE]
| field | type | default | flag / operand |
|---|---|---|---|
input | Text | "" | FILE |
n | Natural | 10 | -n, --lines N |
fx-hostnameprint the system's host name
usage: fx-hostname
| field | type | default | flag / operand |
|---|---|---|---|
nothing | Bool | True | — |
fx-idprint user and group identity for USER (or the caller)
usage: fx-id [OPTIONS] [USER]
| field | type | default | flag / operand |
|---|---|---|---|
all | Bool | False | -G |
gid | Bool | False | -g |
names | Bool | False | -n |
real | Bool | False | -r |
uid | Bool | False | -u |
user | Text | "" | USER |
Mutually exclusive: -u -g -G
fx-linkcreate a hard link OLD -> NEW via linkat, journaled
usage: fx-link [OLD] [NEW]
| field | type | default | flag / operand |
|---|---|---|---|
new | Text | "" | NEW |
old | Text | "" | OLD |
fx-lncreate links between files (-s for symbolic)
usage: fx-ln [OPTIONS] [TARGET] [LINK_NAME]
| field | type | default | flag / operand |
|---|---|---|---|
dst | Text | "" | LINK_NAME |
src | Text | "" | TARGET |
symbolic | Bool | False | -s, --symbolic |
fx-lslist a directory's entries as Datalog-backed stat rows
usage: fx-ls [OPTIONS] [PATH]
| field | type | default | flag / operand |
|---|---|---|---|
all | Bool | False | -a, --all |
long | Bool | False | -l, --long |
path | Text | "." | PATH |
rows | Bool | False | --rows |
sort | < MTime | Name | Size > | < MTime | Name | Size >.Name | -S -t |
Mutually exclusive: -S -t
fx-md5sumprint or check MD5 (128-bit) checksums
usage: fx-md5sum [OPTIONS] [FILE...]
| field | type | default | flag / operand |
|---|---|---|---|
binary | Bool | False | -b, --binary |
files | List Text | [] | FILE … |
fx-mkdircreate directories (-p for parents), journaled
usage: fx-mkdir [OPTIONS] [DIR...]
| field | type | default | flag / operand |
|---|---|---|---|
parents | Bool | False | -p, --parents |
paths | List Text | [] | DIR … |
fx-mkfifocreate FIFOs with mkfifo(3), -m sets the mode
usage: fx-mkfifo [OPTIONS] [NAME...]
| field | type | default | flag / operand |
|---|---|---|---|
mode | Optional Text | None | -m, --mode TEXT |
paths | List Text | [] | NAME … |
fx-mvrename SOURCE to DEST, or move SOURCE into DIRECTORY
usage: fx-mv [SRC] [DST]
| field | type | default | flag / operand |
|---|---|---|---|
dst | Text | "" | DST |
src | Text | "" | SRC |
fx-nlnumber lines of a file or stdin (GNU nl)
usage: fx-nl [OPTIONS] [FILE]
| field | type | default | flag / operand |
|---|---|---|---|
body | Text | "t" | -b, --body-numbering TEXT |
file | Text | "" | FILE |
fmt | Text | "rn" | -n, --number-format TEXT |
sep | Text | " " | -s, --number-separator TEXT |
width | Natural | 6 | -w, --number-width N |
fx-pastemerge corresponding or subsequent lines of files (GNU paste)
usage: fx-paste [OPTIONS] [FILE...]
| field | type | default | flag / operand |
|---|---|---|---|
delim | Text | " " | -d, --delimiters TEXT |
files | List Text | [] | FILE … |
serial | Bool | False | -s, --serial |
fx-pssnapshot running processes as a datalog-backed view
usage: fx-ps [OPTIONS]
| field | type | default | flag / operand |
|---|---|---|---|
rows | Bool | False | --rows |
sort | < Cpu | Mem | Pid > | < Cpu | Mem | Pid >.Pid | -c -m |
Mutually exclusive: -c -m
fx-realpathprint the resolved absolute file name
usage: fx-realpath [FILE...]
| field | type | default | flag / operand |
|---|---|---|---|
names | List Text | [] | FILE … |
fx-rmremove files or directories (-r), journaled with CAS capture
usage: fx-rm [OPTIONS] [FILE...]
| field | type | default | flag / operand |
|---|---|---|---|
paths | List Text | [] | FILE … |
recursive | Bool | False | -r, --recursive |
fx-rmdirremove empty directories, journaled
usage: fx-rmdir [DIR...]
| field | type | default | flag / operand |
|---|---|---|---|
paths | List Text | [] | DIR … |
fx-seqprint a sequence of numbers FIRST..LAST (step INC)
usage: fx-seq
| field | type | default | flag / operand |
|---|---|---|---|
first | Integer | 1 | — |
inc | Integer | 1 | — |
last | Integer | 0 | — |
fx-sha1sumprint or check SHA-1 (160-bit) checksums
usage: fx-sha1sum [OPTIONS] [FILE...]
| field | type | default | flag / operand |
|---|---|---|---|
binary | Bool | False | -b, --binary |
files | List Text | [] | FILE … |
fx-sha224sumprint or check SHA-224 checksums
usage: fx-sha224sum [OPTIONS] [FILE...]
| field | type | default | flag / operand |
|---|---|---|---|
binary | Bool | False | -b, --binary |
files | List Text | [] | FILE … |
fx-sha256sumprint or check SHA-256 checksums
usage: fx-sha256sum [OPTIONS] [FILE...]
| field | type | default | flag / operand |
|---|---|---|---|
binary | Bool | False | -b, --binary |
files | List Text | [] | FILE … |
fx-sha384sumprint or check SHA-384 checksums
usage: fx-sha384sum [OPTIONS] [FILE...]
| field | type | default | flag / operand |
|---|---|---|---|
binary | Bool | False | -b, --binary |
files | List Text | [] | FILE … |
fx-sha512sumprint or check SHA-512 checksums
usage: fx-sha512sum [OPTIONS] [FILE...]
| field | type | default | flag / operand |
|---|---|---|---|
binary | Bool | False | -b, --binary |
files | List Text | [] | FILE … |
fx-sortsort lines (numeric, reverse, unique) as Datalog-backed rows
usage: fx-sort [OPTIONS] [FILE]
| field | type | default | flag / operand |
|---|---|---|---|
input | Text | "" | FILE |
numeric | Bool | False | -n, --numeric-sort |
reverse | Bool | False | -r, --reverse |
unique | Bool | False | -u, --unique |
fx-sumprint checksum and block count for each FILE (-s SysV)
usage: fx-sum [OPTIONS] [FILE...]
| field | type | default | flag / operand |
|---|---|---|---|
files | List Text | [] | FILE … |
sysv | Bool | False | -s, --sysv |
fx-tailprint the last N lines (-n, default 10) of FILEs (or stdin)
usage: fx-tail [OPTIONS] [FILE]
| field | type | default | flag / operand |
|---|---|---|---|
input | Text | "" | FILE |
n | Natural | 10 | -n, --lines N |
fx-teecopy stdin to each FILE and to stdout (-a appends)
usage: fx-tee [OPTIONS] [FILE...]
| field | type | default | flag / operand |
|---|---|---|---|
append | Bool | False | -a, --append |
files | List Text | [] | FILE … |
fx-topsingle-shot process ranking by total cpu ticks or memory
usage: fx-top [OPTIONS]
| field | type | default | flag / operand |
|---|---|---|---|
count | Natural | 15 | -n N |
rows | Bool | False | --rows |
sort | < Cpu | Mem > | < Cpu | Mem >.Cpu | -m |
fx-touchcreate files or update timestamps, journaled
usage: fx-touch [FILE...]
| field | type | default | flag / operand |
|---|---|---|---|
files | List Text | [] | FILE … |
fx-treerender a directory closure as a tree (Datalog descent)
usage: fx-tree [OPTIONS] [ROOT]
| field | type | default | flag / operand |
|---|---|---|---|
all | Bool | False | -a, --all |
dirs_only | Bool | False | -d, --dirs-only |
maxdepth | Optional Natural | None | -L N |
root | Text | "." | ROOT |
rows | Bool | False | --rows |
fx-truncateshrink or extend a file to SIZE (-r REF), CAS-captured
usage: fx-truncate [OPTIONS] [FILE...]
| field | type | default | flag / operand |
|---|---|---|---|
files | List Text | [] | FILE … |
no_create | Bool | False | -c, --no-create |
ref | Optional Text | None | -r, --reference TEXT |
size | Optional Text | None | -s, --size TEXT |
Mutually exclusive: -s -r
fx-unameprint system information (-a: all)
usage: fx-uname [OPTIONS]
| field | type | default | flag / operand |
|---|---|---|---|
all | Bool | False | -a, --all |
kernel | Bool | False | -s, --kernel-name |
machine | Bool | False | -m, --machine |
nodename | Bool | False | -n, --nodename |
os | Bool | False | -o, --operating-system |
release | Bool | False | -r, --release |
version | Bool | False | -v |
fx-uniqfilter repeated adjacent lines in sorted input (-c counts)
usage: fx-uniq [OPTIONS] [FILE]
| field | type | default | flag / operand |
|---|---|---|---|
count | Bool | False | -c, --count |
global | Bool | False | -g, --global |
input | Text | "" | FILE |
fx-unlinkdelete a name and possibly the file it refers to
usage: fx-unlink [PATH]
| field | type | default | flag / operand |
|---|---|---|---|
path | Text | "" | PATH |
fx-wcprint newline, word and byte counts for each FILE
usage: fx-wc [FILE]
| field | type | default | flag / operand |
|---|---|---|---|
input | Text | "" | FILE |
fx-whatquery which package owns a rootfs PATH (provenance)
usage: fx-what [OPTIONS] [PATH]
| field | type | default | flag / operand |
|---|---|---|---|
as_of | Optional Natural | None | --as-of N |
operand | Text | "" | PATH |
store | Optional Text | None | --store TEXT |
fx-whoamiprint the effective user name
usage: fx-whoami
| field | type | default | flag / operand |
|---|---|---|---|
nothing | Bool | True | — |
fx-whyexplain why a package is in the store (provenance)
usage: fx-why [OPTIONS] [PKG]
| field | type | default | flag / operand |
|---|---|---|---|
as_of | Optional Natural | None | --as-of N |
operand | Text | "." | PKG |
store | Optional Text | None | --store TEXT |
fx-yesrepeatedly output STRING (or 'y'), one per line, until killed
usage: fx-yes [STRING...]
| field | type | default | flag / operand |
|---|---|---|---|
strings | List Text | [] | STRING … |