1. Project Overview & Quickstart (uutils/coreutils)
File: README.md
uutils coreutils is a cross-platform reimplementation of the GNU coreutils in
Rust. While all programs have been implemented, some
options might be missing or different behavior might be experienced.
We provide prebuilt binaries, manpages, and shell completions from main branch at https://github.com/uutils/coreutils/releases/tag/latest-commit .
The latest stable tag https://github.com/uutils/coreutils/releases/latest also exists for reproducible products and packagers.
Bug reporters should use binary from latest commit.
Minimal compatible glibc version is same with ubuntu-latest runner. Use coreutils-*-musl if coreutils-*-gnu is not compatible with your system.
Goals
uutils coreutils aims to be a drop-in replacement for the GNU utils. Differences with GNU
are treated as bugs.
Our key objectives include:
- Matching GNU's output (stdout and error code) exactly
- Better error messages
- Providing comprehensive internationalization support (UTF-8)
- Improved performances
- Extensions when relevant (example: --progress)
uutils aims to work on as many platforms as possible, to be able to use the same
utils on Linux, macOS, *BSD, Windows, WASI and other platforms. This ensures, for example,
that scripts can be easily transferred between platforms.
uutils coreutils ships by default on Ubuntu since version 25.10.
Documentation
uutils has both user and developer documentation available:
Both can also be generated locally, the instructions for that can be found in
the coreutils docs repository.
Use weblate/rust-coreutils to translate the Rust coreutils into your language.
You can try the utilities in your browser through the
WebAssembly playground, without
installing anything.
Requirements
- Rust (
cargo,rustc) - GNU Make (optional)
Rust Version
uutils follows Rust's release channels and is tested against stable, beta and
nightly.
Building
There are currently two methods to build the uutils binaries: either Cargo or
GNU Make.
Building the full package, including all documentation, requires both Cargo
and GNU Make on a Unix platform.
For either method, we first need to fetch the repository:
git clone https://github.com/uutils/coreutils
cd coreutilsCargo
Building uutils using Cargo is easy because the process is the same as for every
other Rust program:
cargo build --releaseReplace --release with --profile=release-small to optimize binary size.
This command builds the most portable common core set of uutils into a multicall
(BusyBox-type) binary, named 'coreutils', on most Rust-supported platforms.
Additional platform-specific uutils are often available. Building these expanded
sets of uutils for a platform (on that platform) is as simple as specifying it
as a feature:
cargo build --release --features windows
# or ...
cargo build --release --features unix
# or ...
cargo build --release --target wasm32-wasip1 --no-default-features --features feat_wasmTo build SELinux-specific features, including chcon and runcon, ensure that libselinux
and libclang are installed on your system. Then, run the following command:
cargo build --release --features unix,feat_selinuxTo speed up the checksum utilities (md5sum, sha1sum, sha224sum, sha256sum,sha384sum, sha512sum, and cksum) by using OpenSSL's libcrypto instead of
the pure-Rust digest crates, enable the openssl feature:
cargo build --release --features opensslBy default OpenSSL is built from source and statically linked into the
binary (mirroring how expr links oniguruma), so no runtime dependency
on system libcrypto/libssl is added. To link dynamically against the system
libcrypto instead, set OPENSSL_NO_VENDOR=1 at build time.
The speedup is largest on CPUs without SHA-NI hardware acceleration. The
feature is a no-op on Windows (the pure-Rust implementations are always used
there) and is automatically bypassed at runtime for any algorithm libcrypto
refuses (for example, MD5 in strict FIPS mode).
If you don't want to build every utility available on your platform into the
final binary, you can also specify which ones you want to build manually. For
example:
cargo build --features "base32 cat echo rm" --no-default-featuresIf you want to build the utilities as individual binaries, that is also possible:
cargo build --release --bins --workspace --exclude coreutils --exclude uu_runcon --exclude uu_chconEach utility is contained in its own package within the main repository, named "uu_UTILNAME". To
build selected individual utilities, use the --package [aka -p] option. For example:
cargo build -p uu_base32 -p uu_cat -p uu_echo -p uu_rmGNU Make
Building using make is a simple process as well.
To simply build all available utilities (with debug profile):
makeIn release mode:
make PROFILE=releaseTo build all but a few of the available utilities:
make SKIP_UTILS='UTILITY_1 UTILITY_2'To build only a few of the available utilities:
make UTILS='UTILITY_1 UTILITY_2'Installation
Install with Cargo
Likewise, installing can simply be done using:
cargo install --path . --lockedThis command will install uutils into Cargo's bin folder (e.g.$HOME/.cargo/bin).
This does not install files necessary for shell completion or manpages. For
manpages or shell completion to work, use GNU Make or seeManually install shell completions/Manually install manpages.
Install with GNU Make
To install all available utilities (PROFILE=release by default):
make installTo install using sudo switch -E must be used:
sudo -E make installTo install all but a few of the available utilities:
make SKIP_UTILS='UTILITY_1 UTILITY_2' installTo install only a few of the available utilities:
make UTILS='UTILITY_1 UTILITY_2' installTo install every program with a prefix (e.g. uu-echo uu-cat):
make PROG_PREFIX=uu- installTo install the multicall binary:
make MULTICALL=y installSet install parent directory (default value is /usr/local):
# DESTDIR is also supported
make PREFIX=/my/path installInstalling with make installs shell completions for all installed utilities
for bash, fish and zsh. Completions for elvish and powershell can also
be generated; See Manually install shell completions.
To skip installation of completions and manpages:
make COMPLETIONS=n MANPAGES=n installManually install shell completions
The uudoc binary generates completions for the bash, elvish,fish, powershell and zsh shells to stdout.
Install uudoc by
cargo install --bin uudoc --features uudoc --path .Then use the installed binary:
uudoc completion <shell>So, to install completions for ls on bash to/usr/local/share/bash-completion/completions/ls, run:
uudoc completion ls bash > /usr/local/share/bash-completion/completions/ls.bashCompletion for prefixed cp with uu- on zsh is generated by
env PROG_PREFIX=uu- uudoc completion cp zshManually install manpages
To generate manpages, the syntax is:
uudoc manpageSo, to install the manpage for ls to /usr/local/share/man/man1/ls.1 run:
uudoc manpage ls > /usr/local/share/man/man1/ls.1Un-installation
Un-installation differs depending on how you have installed uutils. If you used
Cargo to install, use Cargo to uninstall. If you used GNU Make to install, use
Make to uninstall.
Uninstall with Cargo
To uninstall uutils:
cargo uninstall coreutilsUninstall with GNU Make
To uninstall all utilities:
make uninstallTo uninstall every program with a set prefix:
make PROG_PREFIX=uu- uninstallTo uninstall the multicall binary:
make MULTICALL=y uninstallTo uninstall from a custom parent directory:
# DESTDIR is also supported
make PREFIX=/my/path uninstallGNU test suite compatibility
Below is the evolution of how many GNU tests uutils passes. A more detailed
breakdown of the GNU test results of the main branch can be found
in the user manual.
See https://github.com/orgs/uutils/projects/1 for the main meta bugs
(many are missing).
Contributing
To contribute to uutils, please see CONTRIBUTING.
License
uutils is licensed under the MIT License - see the LICENSE file for details
GNU Coreutils is licensed under the GPL 3.0 or later.
File: docs/src/extensions.md
Extensions over GNU
Though the main goal of the project is compatibility, uutils supports a few
features that are not supported by GNU coreutils. We take care not to introduce
features that are incompatible with the GNU coreutils. Below is a list of uutils
extensions.
General
GNU coreutils provides two ways to define short options taking an argument:
$ ls -w 80
$ ls -w80We support a third way:
$ ls -w=80With GNU coreutils, --help usually prints the help message and --version prints the version.
We also commonly provide short options: -h for help and -V for version.
`coreutils`
Our coreutils calls utility by coreutils utility-name and has --list to run against busybox test suite.
Our coreutils is called as utility-name if its binary name ends with utility-name to support prefixed names.
Longer name is prioritized e.g. sum with the prefix ck is called as cksum.
`base32/base64/basenc`
Just like on macOS, base32/base64/basenc provides -D to decode data.
`cp`
cp can display a progress bar when the -g/--progress flag is set.
`du`
du allows birth and creation as values for the --time argument to show the creation time. It
also provides a -v/--verbose flag.
`env`
GNU env allows the empty string to be used as an environment variable name.
This is unsupported by uutils, which will show a warning for any such
assignment.
env has an additional -f/--file flag that can
parse .env files and set variables accordingly. This feature is adopted from dotenv style
packages.
`expand`
expand offers the -U/--no-utf8 option to interpret input files as 8-bit ASCII instead of UTF-8.
`fmt`
fmt has additional flags for prefixes: -P/--skip-prefix, -x/--exact-prefix, and-X/--exact-skip-prefix. With -m/--preserve-headers, an attempt is made to detect and preserve
mail headers in the input. -q/--quick breaks lines more quickly. And -T/--tab-width defines the
number of spaces representing a tab when determining the line length.
`id`
id has three additional flags:
-Pdisplays the id as a password file entry-pmakes the output human-readable-Adisplays the process audit user ID
`install`
install offers FreeBSD's -U unprivileged option to not change the owner, the group, or the file flags of the destination.
`ls`
GNU ls provides two ways to use a long listing format: -l and --format=long. We support a
third way: --long.
GNU ls --sort=VALUE only supports special non-default sort orders.
We support --sort=name, which makes it possible to override an earlier value.
`more`
We provide a simple implementation of more, which is not part of GNU
coreutils. We do not aim for full compatibility with the more utility fromutil-linux. Features from more modern pagers (like less and bat) are
therefore welcomed.
`mv`
mv can display a progress bar when the -g/--progress flag is set.
`printf`
printf uses arbitrary precision decimal numbers to parse and format floating point
numbers. GNU coreutils uses long double, whose actual size may be double precision
64-bit float
(e.g 32-bit arm), extended precision 80-bit float
(x86(-64)), or
quadruple precision 128-bit float (e.g. arm64).
Practically, this means that printing a number with high precision will remain exact:
printf "%.48f\n" 0.1
0.100000000000000000000000000000000000000000000000 << uutils on all platforms
0.100000000000000000001355252715606880542509316001 << GNU coreutils on x86(-64)
0.100000000000000000000000000000000004814824860968 << GNU coreutils on arm64
0.100000000000000005551115123125782702118158340454 << GNU coreutils on armv7 (32-bit)Hexadecimal floats
For hexadecimal float format (%a), POSIX only states that one hexadecimal number
should be present left of the decimal point (0xh.hhhhpยฑd [1]), but does not say how
many bits should be included (between 1 and 4). On x86(-64), the first digit always
includes 4 bits, so its value is always between 0x8 and 0xf, while on other
architectures, only 1 bit is included, so the value is always 0x1.
However, the first digit will of course be 0x0 if the number is zero. Also,
rounding numbers may cause the first digit to be 0x1 on x86(-64) (e.g.0xf.fffffffp-5 rounds to 0x1.00p-1), or 0x2 on other architectures.
We chose to replicate x86-64 behavior on all platforms.
Additionally, the default precision of the hexadecimal float format (%a without
any specifier) is expected to be "sufficient for exact representation of the value" [1].
This is not possible in uutils as we store arbitrary precision numbers that may be
periodic in hexadecimal form (0.1 = 0xc.ccc...p-7), so we revert
to the number of digits that would be required to exactly print an
extended precision 80-bit float,
emulating GNU coreutils behavior on x86(-64). An 80-bit float has 64 bits in its
integer and fractional part, so 16 hexadecimal digits are printed in total (1 digit
before the decimal point, 15 after).
Practically, this means that the default hexadecimal floating point output is
identical to x86(-64) GNU coreutils:
printf "%a\n" 0.1
0xc.ccccccccccccccdp-7 << uutils on all platforms
0xc.ccccccccccccccdp-7 << GNU coreutils on x86-64
0x1.999999999999999999999999999ap-4 << GNU coreutils on arm64
0x1.999999999999ap-4 << GNU coreutils on armv7 (32-bit)We can print an arbitrary number of digits if a larger precision is requested,
and the leading digit will still be in the 0x8-0xf range:
printf "%.32a\n" 0.1
0xc.cccccccccccccccccccccccccccccccdp-7 << uutils on all platforms
0xc.ccccccccccccccd00000000000000000p-7 << GNU coreutils on x86-64
0x1.999999999999999999999999999a0000p-4 << GNU coreutils on arm64
0x1.999999999999a0000000000000000000p-4 << GNU coreutils on armv7 (32-bit)Note: The architecture-specific behavior on non-x86(-64) platforms may change in
the future.
`rm`
rm can display a progress bar when the -g/--progress flag is set.
`seq`
Unlike GNU coreutils, seq always uses arbitrary precision decimal numbers, no
matter the parameters (integers, decimal numbers, positive or negative increments,
format specified, etc.), so its output will be more correct than GNU coreutils for
some inputs (e.g. small fractional increments where GNU coreutils uses long double).
The only limitation is that the position of the decimal point is stored in a i64,
so values smaller than 10**(-263) will underflow to 0, and some values larger
than 10(2**63) may overflow to infinity.
See also comments under printf for formatting precision and differences.
seq provides -t/--terminator to set the terminator character.
`sort`
When sorting with -g/--general-numeric-sort, arbitrary precision decimal numbers
are parsed and compared, unlike GNU coreutils that uses platform-specific long
double floating point numbers.
Extremely large or small values can still overflow or underflow to infinity or zero,
see note in seq.
`unexpand`
GNU unexpand provides --first-only to convert only leading sequences of blanks. We support a
second way: -f like busybox.
With -U/--no-utf8, you can interpret input files as 8-bit ASCII rather than UTF-8.
`uptime`
Similar to the proc-ps implementation and unlike GNU/Coreutils, uptime provides:
-s/--sinceto show since when the system is up-p/--prettyto display uptime in a pretty-printed format
File: docs/src/index.md
{{#include logo.svg}}
uutils Coreutils Documentation
uutils is an attempt at writing universal (as in cross-platform) CLI utilities
in Rust. It is available for Linux, Windows, Mac
and other platforms.
The API reference for uucore, the library of functions shared between various
utils, is hosted at docs.rs.
uutils is licensed under the
MIT License.
Useful links
Note: This manual is automatically generated from the source code and is a
work in progress.
File: docs/src/installation.md
Installation
This is a list of uutils packages in various distributions and package managers.
Note that these are packaged by third-parties and the packages might contain
patches.
You can also build uutils from source.
Cargo
# Unix like
cargo install coreutils --features unix --locked
# Windows
cargo install coreutils --features windows --lockedLinux
Alpine
apk update uutils-coreutilsNote: Requires the
edgerepository.
Arch
pacman -S uutils-coreutilsDebian
apt install rust-coreutils
# To use it:
export PATH=/usr/lib/cargo/bin/coreutils:$PATHFedora
dnf install uutils-coreutils
# To use it:
export PATH=/usr/libexec/uutils-coreutils:$PATHGentoo
emerge -pv sys-apps/uutils-coreutilsManjaro
pacman -S uutils-coreutils
# or
pamac install uutils-coreutilsNixOS
nix-env -iA nixos.uutils-coreutilsOpenMandriva Lx
dnf install uutils-coreutilsRHEL/AlmaLinux/CENTOS Stream/Rocky Linux/EPEL 9
# Install EPEL 9 - Specific For RHEL please check codeready-builder-for-rhel-9 First then install epel
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -y
# Install Core Utils
dnf install uutils-coreutils
# To use it:
export PATH=/usr/libexec/uutils-coreutils:$PATHUbuntu
apt install rust-coreutils
# To use it:
export PATH=/usr/lib/cargo/bin/coreutils:$PATHAUR
Build main branch from source
or
Binaries from main branch
git clone https://aur.archlinux.org/uutils-coreutils-git --depth=1
cd uutils-coreutils-git
makepkg -siMacOS
Homebrew
brew install uutils-coreutilsMacPorts
port install coreutils-uutilsFreeBSD
pkg install rust-coreutilsWindows
Winget
winget install uutils.coreutilsScoop
scoop install uutils-coreutilsMSYS2
MSYS2 package (Windows native)
Alternative installers
Conda
conda install -c conda-forge uutils-coreutilsYocto
The uutils-coreutils recipe is provided as part of the meta-openembedded yocto layer.
Clone poky and meta-openembedded, addmeta-openembedded/meta-oe as layer in your build/conf/bblayers.conf file,
and then either call bitbake uutils-coreutils, or usePREFERRED_PROVIDER_coreutils = "uutils-coreutils" in your build/conf/local.conf file and
then build your usual yocto image.
File: docs/src/multicall.md
Multi-call binary
uutils includes a multi-call binary from which the utils can be invoked. This
reduces the binary size of the binary and can be useful for portability.
The first argument of the multi-call binary is the util to run, after which
the regular arguments to the util can be passed.
coreutils [util] [util options]The --help flag will print a list of available utils.
Example
coreutils ls -lFile: docs/src/packaging.md
Packaging coreutils
Note: This page is intended as a guide for packaging the uutils coreutils
for package maintainers. Normal users probably do not need to read this. If you
just want to install the coreutils, look at the
installation instructions.
The maintainers of this project do not have the capacity to maintain packages
for every distribution and package manager out there. Therefore, we encourage
other people to package the uutils coreutils for their preferred distributions.
You do not need to ask permission for this and you can do this however you want
as long as you comply with the license. However, we do like to hear and
advertise where the uutils coreutils are available, so please do let us know!
License
The uutils coreutils are licensed under the MIT license. See the
LICENSE for the full
license text. Make sure to add attribution and the license text to the package
to comply with the license.
Package
We recommend to name the package uutils-coreutils. Just uutils is incorrect,
because that is the name of the organization, which also includes other
projects.
Selecting the utils to include
Not all utils are available on all platforms. To get the full set of utils for a
particular platform, you must enable the feature flag corresponding to the platform name.
For example, on Unix-like system, use --features unix and --features windows
on Windows.
For a more fine-grained selection, you can enable just the features with the
name of the utils you want to include and disable the default feature set.
Additionally, support for SELinux must be explicitly enabled with thefeat_selinux feature.
We recommend including all the utilities that a platform supports.
Compilation parameters
There are several compile-time flags that allow you to tune the coreutils to
your particular needs. Some distributions, for example, might choose to
minimize the binary size as much as possible.
This can be achieved by customizing the configuration passed to cargo. You can
view the full documentation in the
cargo documentation.
We provide three release profiles out of the box, though you may want to tweak
them:
release: The profile with all performance optimization enabled.release-small: Optimize binary size.
They include panic abort which removes stack traces on old rust [https://blog.rust-lang.org/2025/12/11/Rust-1.92.0/].
For the precise definition of these profiles, you can look at the rootCargo.toml.
The profiles above are just examples. We encourage package maintainers to decide
for themselves what the best parameters for their distribution are. For example,
a distribution focused on embedded systems would probably chooserelease-small, but another distribution focused on security might enable
bounds checks.
It is also possible to split the debuginfo into a separate package. See thesplit-debuginfo
option in cargo.
Additional artifacts
This project supports automatically generating manpages and shell completion
files which you may want to include in the package. See the page on
building from source for how to generate these.
2. Official Technical Reference & Guides (uutils/uutils.github.io)
coreutils documentations
This repository generates the user and dev documentations of https://github.com/uutils/coreutils
User documentation
It is available on:
https://uutils.org/coreutils/docs/
Can be generated with:
cargo run --bin uudoc --all-features
cd docs
mdbook buildPlayground
An in-browser playground runs the uutils coreutils WASM build directly in your browser:
https://uutils.org/playground/
See also how it works: https://uutils.org/playground-how-it-works/
Developer documentation:
It is available on:
https://uutils.org/dev/coreutils/
Can be generated with:
cargo doc --no-deps --all-features --workspaceThe website CI builds this on each main/scheduled run and publishes it
under /dev/coreutils/ (and /dev/findutils/) as part of the deploy.
Build timing
Generated by cargo, the build timings can be seen on:
https://uutils.org/cargo-timings/cargo-timing.html