Skip to main content
CleanStart

Knowledge Hub

cleanstart-utils Reference

Version: 1.5.5 Binary: cleanstart-utils (alias: csu)

What It Does

cleanstart-utils is a BusyBox-style multi-call binary written in Rust. It provides 33 common Unix utilities in a single, memory-safe static binary for use inside CleanStart containers. Instead of installing coreutils, grep, tar, and wget separately, you get one binary that handles all of them.

Usage

Two invocation styles:

# Direct invocationcleanstart-utils cp -r /src /dstcsu grep -i "error" /var/log/app.log # Symlink invocation (zero-overhead)ln -s /usr/local/bin/cleanstart-utils /bin/cp/bin/cp -r /src /dst

When invoked with no arguments, it prints the version and lists all available applets.

Complete Applet List

Filesystem

Command

Usage

Key Flags

cp

cp [-r] [-p] [-f] [-v] [-n] src... dst

-r recursive, -n no-clobber, -v verbose

mv

mv [-f] [-v] src... dst

-f force, -v verbose

rm

rm [-r] [-f] [-v] path...

-r recursive, -f force

mkdir

mkdir [-p] [-v] [-m MODE] dir...

-p parents, -m mode

chmod

chmod [-R] [-v] MODE path...

-R recursive

ln

ln [-s] [-f] [-v] target link

-s symbolic, -f force

touch

touch [-a] [-m] [-t TIME] file...

-t timestamp

cat

cat [-n] file...

-n line numbers

stat

stat [-c FMT] file...

-c format string

Text Processing

Command

Usage

Key Flags

grep

grep [-i] [-v] [-c] [-l] [-n] [-r] [-E] pattern [file...]

-i case-insensitive, -r recursive, -E extended regex

head

head [-n N] [file...]

-n line count

tail

tail [-n N] [-f] [file...]

-n line count, -f follow

wc

wc [-l] [-w] [-c] [file...]

-l lines, -w words, -c bytes

sort

sort [-r] [-n] [-u] [-k FIELD] [file...]

-r reverse, -n numeric, -u unique

uniq

uniq [-c] [-d] [-u] [file]

-c count, -d duplicates only

sed

sed [-i] [-e EXPR] [file...]

-i in-place, -e expression

echo

echo [-n] [-e] [string...]

-n no newline, -e escape sequences

printf

printf format [args...]

C-style format strings

Directory and Environment

Command

Usage

Description

ls

ls [-l] [-a] [-h] [-R] [path...]

List directory contents

pwd

pwd

Print working directory

id

id [-u] [-g] [-n]

Print user/group identity

which

which command

Locate a command

env

env [NAME=VALUE...] [cmd]

Print or set environment

printenv

printenv [NAME]

Print environment variables

date

date [-u] [+FORMAT]

Print date/time

sleep

sleep SECONDS

Pause execution

kill

kill [-SIGNAL] PID...

Send signal to process

true

true

Exit 0

false

false

Exit 1

Archives

Command

Usage

Key Flags

tar

tar [-c|-x|-t] [-z|-J] [-f FILE] [-C DIR] [paths...]

-z gzip, -J xz, -C change dir

unzip

unzip [-o] [-d DIR] file.zip

-o overwrite, -d extract dir

gzip

gzip [-d] [-k] [-f] file...

-d decompress, -k keep original

gunzip

gunzip [-k] [-f] file...

-k keep original

Network

Command

Usage

Key Flags

fetch

fetch [-o FILE] URL

-o output file

wget

wget [-O FILE] [-q] URL

-O output file, -q quiet

All network operations use TLS 1.3 via rustls (no OpenSSL dependency).

Shell

Command

Description

sh / ash / csu-sh

Minimal POSIX-subset shell for basic scripting

The built-in shell handles simple command execution, pipes, and redirects. Complex shell features delegate to /bin/sh if available.

Feature Flags

All features are enabled by default. When a feature is disabled at compile time, its commands return a "not compiled in" error.

Feature

Commands

Dependencies

sed_builtin

sed

None

grep_builtin

grep

regex 1.10

archive

tar, unzip, gzip, gunzip

tar, flate2, xz2

net

fetch, wget

ureq (rustls TLS 1.3)

chrono_tools

date (format strings)

chrono 0.4

Shared Library

cleanstart-utils also ships as libcleanstart for embedding in other tools:

use libcleanstart::{dispatch_builtin, env_expand}; // Run a builtin commanddispatch_builtin("mkdir", &["-p", "/data/logs"]); // Expand environment variableslet expanded = env_expand("$HOME/.config");

This is how cleanimg-init provides its 16 builtins -- it links against libcleanstart rather than reimplementing them.