Skip to content

unixwin/WinuxCmd

Repository files navigation

WinuxCmd

English | 中文

GNU-style command layer for Windows-native shells.

GitHub release (latest by date) GitHub all releases GitHub stars GitHub license Windows Support

WinuxCmd provides native Windows implementations of familiar Unix/GNU commands such as ls, cat, grep, find, xargs, rm, cp, mv, sed, sort, and uniq.

It is the command layer used by winuxsh, and it can also be installed directly for PowerShell, Command Prompt, Windows Terminal, build scripts, and CI jobs.

Windows Terminal

Recommended: Winuxsh

If you want a bash-like terminal on Windows, start with winuxsh:

winuxsh = rubash shell engine + reedline frontend + winuxcmd coreutils

Winuxsh gives you bash-compatible shell syntax, prompt/git integration, history, completions, and a bundled WinuxCmd command set without requiring WSL, MSYS2, Git Bash, or PowerShell semantics.

Download the matching package from the winuxsh releases:

# choose x64 or arm64, unzip, then run:
.\winuxsh.exe

The winuxsh release package carries its own architecture-matched winuxcmd/winuxcmd.exe and activation script. That copy is intentionally isolated from any WinuxCmd you install with winget or an installer for PowerShell.

PowerShell Install

If you want GNU-style commands inside your existing PowerShell workflow, install WinuxCmd directly:

winget install caomengxuan666.WinuxCmd

Then use commands through winuxcmd:

winuxcmd ls -la
winuxcmd grep --color=auto TODO README.md
winuxcmd find . -name "*.cpp"

For interactive PowerShell sessions, the package also includes winux.ps1 / winux.cmd helpers. After profile setup, winux activate can override common PowerShell aliases such as ls, cat, rm, grep, and man in the current session; winux deactivate restores the original aliases.

Keep The Channels Separate

Use the right channel for the job:

  • winuxsh release: bundles its own winuxcmd/ directory for the shell. Upgrade it by upgrading winuxsh.
  • winget / installer release: installs WinuxCmd for PowerShell, Command Prompt, and direct winuxcmd <command> usage.
  • Development builds: use local hardlinks or winuxcmd <command> from the build tree.

Do not make winuxsh depend on a winget-installed WinuxCmd in normal use. The shell package is designed to be self-contained so x64 and arm64 builds stay reproducible.

External Tools With WPM

WinuxCmd intentionally stays focused on the GNU-style command layer it can maintain well. Complete third-party tools such as jq, ncat, 7z, zstd, and yq should come from WPM-managed external packages or another package manager instead of partial built-ins.

WPM installs external executables directly into the selected WinuxCmd root by default. That means wpm install jq --root <dir> places jq.exe beside winuxcmd.exe, so adding that one directory to PATH is enough. Package indexes can still map support files explicitly when a tool needs side-by-side DLLs.

Typical flow:

winuxcmd wpm source list
winuxcmd wpm index update
winuxcmd wpm install jq --root "C:\path\to\winuxcmd"
winuxcmd wpm links rebuild --root "C:\path\to\winuxcmd"

For winuxsh bundles, run WPM against the bundled WinuxCmd directory, not a separate winget install. Keep external helper executables in the same PATH-visible directory that winuxsh uses for bundled commands.

Why WinuxCmd Exists

Windows developers constantly receive Linux-flavored commands from docs, CI logs, issue comments, shell snippets, and muscle memory. WinuxCmd makes those text workflows useful on Windows without asking you to leave Windows.

It focuses on:

  • native Windows process behavior and paths
  • familiar GNU-style command-line flags where they matter
  • predictable pipelines with Windows tools such as tasklist, netstat, sc, and ipconfig
  • compatibility with older Windows PowerShell 5.1 script environments
  • small release artifacts that can be bundled by other tools

What It Feels Like

netstat -ano | grep 8080
tasklist | grep -i chrome
ipconfig | grep -i ipv4
dir /b | grep -E "\.cpp$" | sort | uniq
find . -name "*.cpp" -print0 | xargs -0 grep -n TODO

The point is not to turn Windows into Linux. The point is to make familiar text workflows work where your files, terminals, scripts, and CI already are.

Command Coverage

WinuxCmd currently implements 153 commands, including practical coverage across:

  • file tools: ls, cp, mv, rm, mkdir, ln, stat, readlink, realpath
  • text tools: cat, grep, sed, sort, uniq, cut, head, tail, wc
  • search and composition: find, xargs
  • Windows-friendly utilities: ps, lsof, which, tree, hexdump, strings

Detailed compatibility references live here:

Windows Notes

  • Unknown commands fall back through the parent shell, so WinuxCmd complements PowerShell and cmd instead of replacing them.
  • --version is handled uniformly by WinuxCmd; do not treat individual command version output as separate compatibility work.
  • Color-aware commands such as grep follow terminal and --color behavior. Use --color=always when you intentionally want ANSI color preserved through a pipe.
  • For interactive cmd use, launching Windows Terminal with %SystemRoot%\System32\cmd.exe /k winuxcmd is safer than a global AutoRun hook.

Building

cmake --preset vs2022
cmake --build build-vs --target winuxcmd --parallel

Useful local checks:

ctest --test-dir build-vs -R "^(grep|find|rm)\." --output-on-failure

More

About

Lightweight, native Windows implementation of Linux commands | 1MB only | AI-friendly

Topics

Resources

License

Contributing

Stars

255 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors