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]

fieldtypedefaultflag / operand
allBoolFalse-a, --multiple
inputText""NAME
namesList Text[]
suffixText""SUFFIX

fx-catconcatenate FILEs (or stdin) to stdout, bytes to bytes

usage: fx-cat [FILE...]

fieldtypedefaultflag / operand
filesList Text[]FILE …

fx-chgrpchange the group ownership of files (datalog-backed stat rows)

usage: fx-chgrp [GROUP] [FILE...]

fieldtypedefaultflag / operand
groupText""GROUP
pathsList Text[]FILE …

fx-chmodchange file mode bits, journaled through the derivation log

usage: fx-chmod [MODE] [FILE...]

fieldtypedefaultflag / operand
modeText""MODE
pathsList Text[]FILE …

fx-chownchange the owner and/or group of files (datalog-backed stat rows)

usage: fx-chown [OWNER] [FILE...]

fieldtypedefaultflag / operand
ownerText""OWNER
pathsList Text[]FILE …

fx-cksumprint CRC checksum (POSIX) and byte count for each FILE

usage: fx-cksum [FILE...]

fieldtypedefaultflag / operand
filesList Text[]FILE …

fx-commcompare two sorted files line by line (three-column output)

usage: fx-comm [OPTIONS] [FILE1] [FILE2]

fieldtypedefaultflag / operand
aText""FILE1
bText""FILE2
oneBoolFalse-1, --suppress-1
threeBoolFalse-3, --suppress-3
twoBoolFalse-2, --suppress-2

fx-cpcopy files, capturing originals to CAS before mutating

usage: fx-cp [SRC] [DST]

fieldtypedefaultflag / operand
dstText""DST
srcText""SRC

fx-dateprint or set the system date and time (UTC)

usage: fx-date [OPTIONS]

fieldtypedefaultflag / operand
formatText"%a %b %e %H:%M:%S %Z %Y"
utcBoolFalse-u, --utc

fx-dfreport filesystem usage in 1K blocks via statvfs

usage: fx-df [OPTIONS] [PATH]

fieldtypedefaultflag / operand
pathText""PATH
rowsBoolFalse--rows

fx-diffcompare two files (or trees, -r) line by line

usage: fx-diff [OPTIONS] [A] [B]

fieldtypedefaultflag / operand
aText""A
bText""B
recursiveBoolFalse-r, --recursive

fx-dirnamestrip the last component from a file name

usage: fx-dirname [NAME...]

fieldtypedefaultflag / operand
namesList Text[]NAME …

fx-duestimate file space usage as Datalog-backed stat rows

usage: fx-du [OPTIONS] [PATH]

fieldtypedefaultflag / operand
maxdepthOptional NaturalNone-d, --max-depth N
pathText"."PATH
rowsBoolFalse--rows
summaryBoolFalse-s, --summarize

fx-echoprint the given STRINGs to stdout, newline-terminated

usage: fx-echo [OPTIONS] [STRING...]

fieldtypedefaultflag / operand
escapesBoolFalse-e
no_newlineBoolFalse-n
stringsList Text[]STRING …

fx-envprint, filter or modify the environment, then run nothing (print form)

usage: fx-env [OPTIONS] [NAME=VALUE...]

fieldtypedefaultflag / operand
ignoreBoolFalse-i, --ignore-environment
setsList Text[]NAME=VALUE …
unsetOptional TextNone-u, --unset TEXT

fx-expandconvert tabs in FILEs (or stdin) to spaces

usage: fx-expand [OPTIONS] [FILE...]

fieldtypedefaultflag / operand
filesList Text[]FILE …
tabstopNatural8-t, --tabs N

fx-findwalk a directory closure via Datalog reachability from ROOT

usage: fx-find [ROOT]

fieldtypedefaultflag / operand
maxdepthOptional NaturalNone
name_globOptional TextNone
rootText"."ROOT
type_filterOptional < Dir | File >None

fx-grepprint lines of files under ROOT matching a regex PATTERN

usage: fx-grep [PATTERN] [ROOT]

fieldtypedefaultflag / operand
maxdepthOptional NaturalNone
name_globOptional TextNone
patternText""PATTERN
rootText"."ROOT

fx-hostnameprint the system's host name

usage: fx-hostname

fieldtypedefaultflag / operand
nothingBoolTrue

fx-idprint user and group identity for USER (or the caller)

usage: fx-id [OPTIONS] [USER]

fieldtypedefaultflag / operand
allBoolFalse-G
gidBoolFalse-g
namesBoolFalse-n
realBoolFalse-r
uidBoolFalse-u
userText""USER

Mutually exclusive: -u -g -G

fx-lncreate links between files (-s for symbolic)

usage: fx-ln [OPTIONS] [TARGET] [LINK_NAME]

fieldtypedefaultflag / operand
dstText""LINK_NAME
srcText""TARGET
symbolicBoolFalse-s, --symbolic

fx-lslist a directory's entries as Datalog-backed stat rows

usage: fx-ls [OPTIONS] [PATH]

fieldtypedefaultflag / operand
allBoolFalse-a, --all
longBoolFalse-l, --long
pathText"."PATH
rowsBoolFalse--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...]

fieldtypedefaultflag / operand
binaryBoolFalse-b, --binary
filesList Text[]FILE …

fx-mkdircreate directories (-p for parents), journaled

usage: fx-mkdir [OPTIONS] [DIR...]

fieldtypedefaultflag / operand
parentsBoolFalse-p, --parents
pathsList Text[]DIR …

fx-mkfifocreate FIFOs with mkfifo(3), -m sets the mode

usage: fx-mkfifo [OPTIONS] [NAME...]

fieldtypedefaultflag / operand
modeOptional TextNone-m, --mode TEXT
pathsList Text[]NAME …

fx-mvrename SOURCE to DEST, or move SOURCE into DIRECTORY

usage: fx-mv [SRC] [DST]

fieldtypedefaultflag / operand
dstText""DST
srcText""SRC

fx-nlnumber lines of a file or stdin (GNU nl)

usage: fx-nl [OPTIONS] [FILE]

fieldtypedefaultflag / operand
bodyText"t"-b, --body-numbering TEXT
fileText""FILE
fmtText"rn"-n, --number-format TEXT
sepText" "-s, --number-separator TEXT
widthNatural6-w, --number-width N

fx-pastemerge corresponding or subsequent lines of files (GNU paste)

usage: fx-paste [OPTIONS] [FILE...]

fieldtypedefaultflag / operand
delimText" "-d, --delimiters TEXT
filesList Text[]FILE …
serialBoolFalse-s, --serial

fx-pssnapshot running processes as a datalog-backed view

usage: fx-ps [OPTIONS]

fieldtypedefaultflag / operand
rowsBoolFalse--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...]

fieldtypedefaultflag / operand
namesList Text[]FILE …

fx-rmremove files or directories (-r), journaled with CAS capture

usage: fx-rm [OPTIONS] [FILE...]

fieldtypedefaultflag / operand
pathsList Text[]FILE …
recursiveBoolFalse-r, --recursive

fx-rmdirremove empty directories, journaled

usage: fx-rmdir [DIR...]

fieldtypedefaultflag / operand
pathsList Text[]DIR …

fx-seqprint a sequence of numbers FIRST..LAST (step INC)

usage: fx-seq

fieldtypedefaultflag / operand
firstInteger1
incInteger1
lastInteger0

fx-sha1sumprint or check SHA-1 (160-bit) checksums

usage: fx-sha1sum [OPTIONS] [FILE...]

fieldtypedefaultflag / operand
binaryBoolFalse-b, --binary
filesList Text[]FILE …

fx-sha224sumprint or check SHA-224 checksums

usage: fx-sha224sum [OPTIONS] [FILE...]

fieldtypedefaultflag / operand
binaryBoolFalse-b, --binary
filesList Text[]FILE …

fx-sha256sumprint or check SHA-256 checksums

usage: fx-sha256sum [OPTIONS] [FILE...]

fieldtypedefaultflag / operand
binaryBoolFalse-b, --binary
filesList Text[]FILE …

fx-sha384sumprint or check SHA-384 checksums

usage: fx-sha384sum [OPTIONS] [FILE...]

fieldtypedefaultflag / operand
binaryBoolFalse-b, --binary
filesList Text[]FILE …

fx-sha512sumprint or check SHA-512 checksums

usage: fx-sha512sum [OPTIONS] [FILE...]

fieldtypedefaultflag / operand
binaryBoolFalse-b, --binary
filesList Text[]FILE …

fx-sortsort lines (numeric, reverse, unique) as Datalog-backed rows

usage: fx-sort [OPTIONS] [FILE]

fieldtypedefaultflag / operand
inputText""FILE
numericBoolFalse-n, --numeric-sort
reverseBoolFalse-r, --reverse
uniqueBoolFalse-u, --unique

fx-sumprint checksum and block count for each FILE (-s SysV)

usage: fx-sum [OPTIONS] [FILE...]

fieldtypedefaultflag / operand
filesList Text[]FILE …
sysvBoolFalse-s, --sysv

fx-tailprint the last N lines (-n, default 10) of FILEs (or stdin)

usage: fx-tail [OPTIONS] [FILE]

fieldtypedefaultflag / operand
inputText""FILE
nNatural10-n, --lines N

fx-teecopy stdin to each FILE and to stdout (-a appends)

usage: fx-tee [OPTIONS] [FILE...]

fieldtypedefaultflag / operand
appendBoolFalse-a, --append
filesList Text[]FILE …

fx-topsingle-shot process ranking by total cpu ticks or memory

usage: fx-top [OPTIONS]

fieldtypedefaultflag / operand
countNatural15-n N
rowsBoolFalse--rows
sort< Cpu | Mem >< Cpu | Mem >.Cpu-m

fx-touchcreate files or update timestamps, journaled

usage: fx-touch [FILE...]

fieldtypedefaultflag / operand
filesList Text[]FILE …

fx-treerender a directory closure as a tree (Datalog descent)

usage: fx-tree [OPTIONS] [ROOT]

fieldtypedefaultflag / operand
allBoolFalse-a, --all
dirs_onlyBoolFalse-d, --dirs-only
maxdepthOptional NaturalNone-L N
rootText"."ROOT
rowsBoolFalse--rows

fx-truncateshrink or extend a file to SIZE (-r REF), CAS-captured

usage: fx-truncate [OPTIONS] [FILE...]

fieldtypedefaultflag / operand
filesList Text[]FILE …
no_createBoolFalse-c, --no-create
refOptional TextNone-r, --reference TEXT
sizeOptional TextNone-s, --size TEXT

Mutually exclusive: -s -r

fx-unameprint system information (-a: all)

usage: fx-uname [OPTIONS]

fieldtypedefaultflag / operand
allBoolFalse-a, --all
kernelBoolFalse-s, --kernel-name
machineBoolFalse-m, --machine
nodenameBoolFalse-n, --nodename
osBoolFalse-o, --operating-system
releaseBoolFalse-r, --release
versionBoolFalse-v

fx-uniqfilter repeated adjacent lines in sorted input (-c counts)

usage: fx-uniq [OPTIONS] [FILE]

fieldtypedefaultflag / operand
countBoolFalse-c, --count
globalBoolFalse-g, --global
inputText""FILE

fx-wcprint newline, word and byte counts for each FILE

usage: fx-wc [FILE]

fieldtypedefaultflag / operand
inputText""FILE

fx-whatquery which package owns a rootfs PATH (provenance)

usage: fx-what [OPTIONS] [PATH]

fieldtypedefaultflag / operand
as_ofOptional NaturalNone--as-of N
operandText""PATH
storeOptional TextNone--store TEXT

fx-whoamiprint the effective user name

usage: fx-whoami

fieldtypedefaultflag / operand
nothingBoolTrue

fx-whyexplain why a package is in the store (provenance)

usage: fx-why [OPTIONS] [PKG]

fieldtypedefaultflag / operand
as_ofOptional NaturalNone--as-of N
operandText"."PKG
storeOptional TextNone--store TEXT

fx-yesrepeatedly output STRING (or 'y'), one per line, until killed

usage: fx-yes [STRING...]

fieldtypedefaultflag / operand
stringsList Text[]STRING …