Unix commands natively on Windows: Microsoft releases its own Coreutils
With Coreutils for Windows, the same shell commands and scripts should run on Windows, Linux, and WSL. Microsoft relies on the Rust implementation.
(Image: Moritz Förster / KI / iX)
With Coreutils for Windows, Microsoft is bringing its collection of classic Unix command-line tools natively to Windows. The package provides familiar commands such as cat, grep, find, or xargs under their usual names. Developers should be able to use the same commands, options, and shell pipelines on Windows, Linux, macOS, in the Windows Subsystem for Linux (WSL), and in containers. The software is available as a preview version and can be installed via WinGet.
For decades, Coreutils have been part of the standard repertoire for Linux administrators and developers. Those who wanted to use these tools on Windows with largely identical behavior previously often resorted to WSL, Git Bash, or Cygwin. With its new Coreutils, Microsoft is now integrating the tools directly into the operating system, thus lowering the barriers between environments.
Rust-based instead of GNU port
Technically, this is not a port of the GNU Coreutils. The project is based on uutils/coreutils, a cross-platform reimplementation of the GNU tools in Rust. Microsoft maintains its Windows build for this, which includes not only the Coreutils but also the Findutils and a GNU-compatible grep. Existing scripts should thus be transferable between platforms without adjustments.
The choice of the Rust project is no coincidence: the language has been playing an increasing role in Microsoft's security and infrastructure projects for several years. The company explicitly calls memory-safe languages the future of secure software development and now also uses Rust in Windows components and driver development.
One binary, many names
Microsoft delivers the package as a so-called multi-call binary. The functions of numerous individual tools are contained within a single binary file, which executes a different program depending on the call name – for example, cat.exe, grep.exe, or find.exe. The concept originates from the Unix world and is also used by BusyBox, among others.
For developers, this means specifically: typical Linux pipelines will now run directly under Windows, for example:
cat access.log | grep 500 | sort | uniq
Similarly, calls such as
find . -name "*.log"
or
grep "ERROR" logfile.txt
should show the same behavior as under Linux.
Consideration for old CMD scripts
Despite the Unix orientation, Microsoft takes existing Windows environments into account. The package contains ports of the classic DOS commands sort and find so that older CMD scripts with their typical /switch syntax continue to run. Especially with find, there has been a name conflict simmering for decades: the Unix variant searches directory trees, while the DOS command searches for character strings in files.
Videos by heise
Not all programs from the uutils project make it into the Windows build. Microsoft deliberately omits several tools because they are based on POSIX-specific concepts, offer little benefit on Windows, or could disrupt existing scripts. These include, among others, chmod, chown, chroot, stty, uname, and sync. The frequently used dd is also missing for now.
Furthermore, Microsoft points out conflicts with built-in commands of CMD and PowerShell. The company specifies PowerShell 7.4 as the minimum requirement. The Coreutils for Windows are released as open-source software; details can be found on the GitHub project page.
(fo)