Real Unix commands. Real Windows paths. One native executable. No WSL Β· No Cygwin Β· No MSYS2 Β· No path-translation pain v2.0.0 β the Rust command core is here. π
unixwin.dev β Docs & downloads
πΎ Install Β· π What's new in 2.0 Β· β‘ Quickstart Β· π 1.x β 2.0 Β· π Docs Β· δΈζ
You're on Windows and you need grep -rn, sed -i, find -exec, xargs -0 β and every option so far is a compromise:
- WSL β 1 GB+ install, and a VM filesystem boundary between you and your files
- Cygwin β path-translation gymnastics and a 2β5 s startup
- GnuWin32 β abandoned in 2012, stuck at 60% compatibility
- uutils β a great Rust project, but ~100 commands and ~600 options
WinuxCmd skips the compromise. One native Win32 executable that speaks GNU syntax on Windows paths: 176 commands, no runtime, no VM. 2.0 moves the command core to Rust β behavior still measured against a GNU oracle, byte for byte.
2.0 is an implementation release, not an interface release: the same commands, names, options, help surface and multicall binary. What changed is what runs underneath.
winuxcmd.exe (one image, one CRT)
βββ C++ front end registration metadata, dispatcher, option policy,
β help/version interception, wpm, retained faces
βββ rust2_bridge the only C++ that touches the ABI
βββ winuxcmd_ffi C ABI v2: winuxcmd_run / winuxcmd_run_stream
βββ winux-cmds library-form commands
βββ winux-core Io / Ctx / HostServices / path / regex seam
- Library-form commands β every wired applet is a function:
run(args, &mut Io, &Ctx) -> CmdResult. IO is injected, cwd and environment are explicit, there is no process-global mutable state, and a command returns a status instead of callingexit(). A panic becomes status 125 at the ABI boundary; it never unwinds into the dispatcher. - One image β the Rust side is a static library folded into
winuxcmd.exeby the same MSVC link. No DLL, no load-time CRT boundary, nothing extra to install. This is the fix for the FFI breakage that stalled the first Rust attempt (#1487). - Streaming stdin β
winuxcmd_run_streamfeeds input through a pull callback, so a command reads incrementally instead of slurping through the ABI. A host-stopped read returns GNU's 124; a read failure maps to the command's own status. winux-regexβ a std-only BRE/ERE engine (GNU extensions, backreferences, POSIX leftmost-longest, glibc capture rules) shared bygrep/sed/find/tacand friends.grep -Pkeeps the existing pinned PCRE2 face; Perl syntax is not reimplemented.- Translation without globals β runtime messages carry stable keys and
English fallbacks; a translation is injected per invocation from the
catalog selected by
WINUX_LANG. English-only builds are the default. - A stricter gate β every wired command passes three gates: GNU oracle byte equality, an unchanged ctest failure set, and an old-vs-new exe byte matrix with each divergence explained.
At the 2.0 freeze, 50 applets run the Rust core, 32 more have a green
differential gate and are queued for the 2.0.x wiring waves, and the
remaining applets keep the 1.x core until their wave. The authoritative
per-command state is DOCS/2.0-inventory.tsv;
the architecture and wiring contract is
rust2/REPLACEMENT-RECIPE.md.
# Install one of the ways below, then use the commands directly:
ls -la
grep -rn "TODO" src/
sed -i 's/http:/https:/g' config.ini
find . -name "*.tmp" -exec rm {} \;
# Full pipelines, zero setup β command links land on your PATH,
# so there are no prefixes and nothing to configure
find . -name "*.cpp" -print0 | xargs -0 wc -l
# Every applet is reachable through the multicall binary too:
winuxcmd grep -c ERROR app.log
winuxcmd --list-all
# Tools that should not be reimplemented install through WPM:
wpm install jqVerify what you are running:
winuxcmd --version
winuxcmd <command> --help| winget | winget install WinuxCmd (ID caomengxuan666.WinuxCmd) |
| Installer (recommended) | WinuxCmd-<version>-x64-setup.exe (or the ARM64 setup) from GitHub Releases |
| Portable | Unzip WinuxCmd-<version>-win-x64.zip anywhere and add it to your PATH |
| Build from source | VS 2022 + CMake 3.30 + Ninja + Rust β see Building from source |
The command set is unchanged. The behavior is GNU-truer where 1.x had invented things. Read the full migration guide before upgrading scripts; the short version:
| Area | 1.x | 2.0 |
|---|---|---|
| Implementation | C++ bodies in winuxcmd.exe |
Rust library functions in the same image |
| Command set / names / options | 176 applets | unchanged (retired 1.x-only option spellings excepted) |
--help / --version text |
WinuxCmd-branded | unchanged (same dispatcher surface) |
| GNU behavior | measured, with tracked deviations | GNU byte-equal on the gated surface; every remaining deviation is classified |
sort speed |
reference | 12x faster plain sort on the 64 MiB NTFS benchmark |
| Streaming stdin | whole-buffer ABI | incremental pull callback (v2) |
| Translations | C++ catalog | per-invocation host injection + separate catalog repo |
| Editions / multicall / WPM | default + full | unchanged |
| Windows subsets | NTFS modes, ownership, symlinks, SELinux, FIFOs | unchanged, documented |
Retired 1.x extensions (GNU has no such option, or treats it as data):
echo -u/--upper, echo -r/--repeat, fold -c,
fmt -m/-P/-x/-X/-T, numfmt --unit-separator/-M/-l and the Z/Y/R/Q
suffixes as 1.x accepted them. Each has a GNU citation in the migration
guide Β§3.
Not yet changed: applets still on the 1.x core behave exactly as in
1.2.1. Their GNU gaps are tracked as compat-gap issues (#1639β#1657) and
will be fixed by their Rust rewrites, not by 2.0.0.
176 applets across GNU coreutils, findutils, grep/sed, util-linux, BSD tools, process management, Cygwin/MSYS bridging and WinuxCmd extensions. The command surface is unchanged from 1.x; what is changing is the engine behind each applet.
| Family | Examples |
|---|---|
| File operations | ls cp mv rm ln mkdir install stat du df |
| Text processing | cat head tail cut tr sort uniq fmt paste pr |
| Search & traversal | find xargs locate updatedb whereis which |
| Digests & encoding | md5sum sha*sum b2sum cksum base64 base32 basenc |
| Paths & links | readlink realpath basename dirname pathchk cygpath |
| Process & system | ps top kill timeout nice nohup free uptime |
| Permissions | chmod chown chgrp getfacl chcon runcon |
| Terminal & docs | tty stty tput clear reset man less more |
| WinuxCmd extensions | wpm regtool mkgroup mkpasswd d2u u2d |
Per-command support state (Rust-wired / deferred / retained face) and the
issue anchors live in
DOCS/2.0-inventory.tsv; the summary is
DOCS/2.0-inventory-summary.md.
2.0 gates each wired command three ways:
- GNU oracle β the wired product vs WSL GNU (coreutils 9.4, findutils
4.9.0, util-linux 2.39.3, Debian hostname 3.23), byte-for-byte on stdout
and exit status for
strictrows. - Existing tests β the full
ctestfailure set must equal the pre-wiring baseline. - Old vs new exe β an argument matrix compares rc/stdout/stderr; every divergence must be explained as a 1.x deviation the replacement corrects.
Case tables are generated (rust2/gate/gen-cases.py); every row is
strict/exit/win/note, and a note row without a registry entry is
itself a finding. The measured narrative is
rust2/GATE-REPORT.md; the wave5 full run
(2026-11-13) covered 82 commands / 2,444 cases, and xargs adds 141. The
release run replaces those numbers.
Windows-value-model rows (id, uname, hostname, getconf, df,
whoami, nproc) gate rc against GNU and stdout against the 1.x value
model; they are recorded, not skipped.
| Document | Description |
|---|---|
| Migration guide 1.x β 2.0 | Per-command differences, retired extensions, platform subsets |
| Release notes 2.0.0 | Bilingual release notes (draft until the tag) |
| Command inventory | 176 applets, three states, exemption anchors |
| Inventory summary | Method, counts, terminal state |
| Regex engine decision | Why winux-regex is a port, and the grep -P exemption |
| Replacement recipe | How one applet is wired (three gates, split engine, streaming, I18N) |
| Gate report | Per-wave differential results |
| Compatibility matrix | 1.x-era per-command support notes |
| WPM guide | Package manager user guide |
| Windows features | Windows-specific behavior |
WinuxCmd ships in two editions built from the same source:
| Default edition | Full edition | |
|---|---|---|
| Assets | WinuxCmd-<version>-win-<arch>.* |
WinuxCmd-<version>-win-<arch>-full.* |
| Entry links | All commands except the full-only names | All entries |
| wpm index | yes | not indexed β standalone download only |
Full-only commands: the default edition does not create entry links for
[ Β· env Β· false Β· kill Β· test Β· time Β·
true. Their user-facing semantics are defined by your host shell's
builtins, so a kill.exe-style entry on PATH advertises a dispatch the
builtin owns. The commands stay fully implemented in the multicall binary β
winuxcmd kill -9 <pid> works in both editions. echo, printf and pwd
keep their entries. The definition lives in one place
(src/core/dispatcher.cppm
is_full_only_command).
wpm install jq # JSON processor
wpm install goawk # awk implementation
wpm install bsdtar # BSD tar
wpm install openssh # SSH client
wpm install make # GNU make
wpm install neovim # text editor
wpm search json # discover packages
wpm list --all # see what's installedDetails in the WPM User Guide.
WinuxCmd gives Windows real Unix commands. niubash gives them a real bash language to live in:
for f in *.log; do
grep -c ERROR "$f" | xargs -I{} echo "$f: {} errors"
done | sort -t: -k2 -rn | head -5niubash injects WinuxCmd's command links onto PATH at startup, so the
grep, sed and find above are the real binaries.
Prerequisites: Visual Studio 2022+ Β· CMake 3.30+ Β· Ninja Β· Rust (stable) with both MSVC targets.
# Build (always use the script; it sets up the VS environment)
./scripts/build-with-vs.ps1
# Build the full edition (all entry links, "-full" asset names)
cmake -B build-full -G Ninja -DCMAKE_BUILD_TYPE=Release -DWINUXCMD_PACKAGE_EDITION=full
# Tests
./scripts/build-with-vs.ps1 -Target winuxcmd-tests
build-vs/tests/winuxcmd-tests.exe-
Install rustup (stable) plus both MSVC targets:
rustup target add x86_64-pc-windows-msvc aarch64-pc-windows-msvc. Theaarch64target is required even on an x64 host when you cross-build arm64: cargo builds the staticlib with--targetfor the C++ target architecture. CI pins the toolchain (RUST2_TOOLCHAINin.github/workflows/build-winuxcmd.yml). -
WINUXCMD_ENABLE_RUST2defaults ON when cargo is found and OFF when it is not;-DWINUXCMD_ENABLE_RUST2=ONwithout cargo is a configure-time error. -
No C++ fallback exists. A Rust-less build omits every command in
WINUXCMD_RUST2_COMMANDS(currently 50) from that build; the command is never dual-tracked (#1550). Official builds ship Rust. -
Cross-arch consistency: CI's
rust2-surface-checkrequires x64 and arm64 packages to carry the same rust2 surface. -
Run the Rust tests:
cd rust2 cargo test -p winux-core -p winux-regex -p winux-cmds
Profile-Guided Optimization (x64): release CI builds the published x64 binary with PGO. To reproduce locally:
./scripts/build-pgo.ps1 # -> build-pgo/usr/bin/winuxcmd.exeTraining workloads are in scripts/pgo-train.sh; ARM64 builds are not
PGO'd (profiles must be collected on the target architecture).
Counted with tokei over the whole tree (tests included), refreshed weekly by the readme-stats workflow:
| Language | Files | Code lines |
|---|---|---|
| C++ | 374 | 122,033 |
| Rust | 152 | 102,415 |
| JSON | 46 | 40,951 |
| C++ Header | 1 | 17,952 |
| Python | 39 | 16,996 |
| Shell | 24 | 5,149 |
| PowerShell | 46 | 4,645 |
| C Header | 16 | 2,978 |
| CMake | 8 | 1,003 |
| C# | 1 | 325 |
| Other | 13 | 293 |
| Total | 720 | 314,740 |
WinuxCmd is maintained by its two core maintainers:
| Maintainer | Role |
|---|---|
| @caomengxuan666 | Creator and core maintainer |
| @arookieofc | Core maintainer |
Thanks to everyone who has contributed code, bug reports, and fixes (emoji key):
caomengxuan666 π» π§ |
arookieofc π» π§ |
Uarz π» |
Catapult291 π» |
daiaji π» |
arookieofc-ai π» |
OpenCode π» |
zzmyth-sys π» |
Haoming9527 π» |
dingyi580 π» |
ShiomiHC π |
qwased π |
Everyone who has landed code (bots excluded), refreshed weekly by the readme-stats workflow:
| Contributor | Commits |
|---|---|
| @caomengxuan666 | 2,062 |
| @arookieofc | 83 |
| @Uarz | 14 |
| @Catapult291 | 4 |
| @daiaji | 4 |
| @arookieofc-ai | 3 |
| @OpenCode | 2 |
| @zzmyth-sys | 2 |
| @Haoming9527 | 1 |
Contributions welcome β see CONTRIBUTING.md. For the Rust
core, read rust2/REPLACEMENT-RECIPE.md
first: a replacement is mechanical, deletes the old body in the same change,
and passes the three gates.
MIT β see LICENSE. PCRE2 is a pinned static dependency (pcre2-10.47) and ships its license with the source tree.
WinuxCmd β because ls shouldn't require a Linux kernel.
Pair it with niubash β the native bash shell that speaks GNU fluently on Windows.