@xiaofeilong99: Windows 党注意了,微软自己下场补 Coreutils 了。 cat、cp、ls、mkdir、pwd、rm、sort、tee 这些命令,以前你在 Linux / macOS 用得好好的,到了 Windows 就各种别扭。 现在微软开…
摘要
微软发布了 Coreutils for Windows,这是一套原生的 Unix 风格核心工具(如 cat、cp、ls 等),旨在减少跨平台脚本和开发环境的差异,可通过 WinGet 安装,目前处于预览阶段。
查看缓存全文
缓存时间: 2026/06/03 21:55
Windows 党注意了,微软自己下场补 Coreutils 了。
cat、cp、ls、mkdir、pwd、rm、sort、tee 这些命令,以前你在 Linux / macOS 用得好好的,到了 Windows 就各种别扭。
现在微软开了个 Coreutils for Windows,官方维护,直接 WinGet 装。
这东西最大的爽点不是“多几个命令”,而是脚本、教程、AI Agent 执行环境终于能少踩很多平台差异坑。
尤其你用 Codex 在 Windows 上跑命令,它再也不用一边猜 PowerShell,一边猜类 Unix 命令。
有些命令会和 Windows 自带命令冲突,别无脑替换系统环境,但拿来做开发环境补丁,很香。
https://github.com/microsoft/coreutils…
microsoft/coreutils
Source: https://github.com/microsoft/coreutils
Coreutils for Windows
UNIX-style core utilities for Windows. The same commands and pipelines you use on Linux, macOS, and WSL - natively.
Install · Shell conflicts · Windows caveats · Contributing
A Microsoft-maintained build of uutils/coreutils, findutils, and grep packaged as a single multi-call binary for Windows. The goal is to make moving between Linux, macOS, WSL, containers, and Windows frictionless: the same commands, flags, and pipelines work the same way, so existing scripts carry over without translation.
Each command supports the standard --help flag for full syntax and options.
This project is in preview.
Install
Install Coreutils for Windows with WinGet:
winget install Microsoft.Coreutils
Or grab the latest build from our Release Page.
Shell conflicts
Any command not mentioned is included in this suite. The following only lists conflicts.
PowerShell 7.4 or newer is required. Older PowerShell versions aren’t supported.
Several commands share names with built-ins in CMD and PowerShell. Whether the Coreutils version runs depends on the shell, the PATH order, and (for PowerShell) the alias table.
Legend: ✅ ships and works · ⚠️ ships but conflicts with a built-in · 🛑 not shipped
| Command | CMD | PowerShell 7.4+ | Notes |
|---|---|---|---|
cat | ✅ | ⚠️ | |
cp | ✅ | ⚠️ | |
date | ⚠️ | ⚠️ | |
dir | 🛑 | 🛑 | Conflicts with the built-in DOS command |
echo | ⚠️ | ⚠️ | |
expand | 🛑 | 🛑 | Conflicts with the built-in DOS command |
find | ✅ | ✅ | Integrated port of the original DOS command |
hostname | ✅ | ✅ | Superset of the Windows built-in |
kill | 🛑 | 🛑 | Unavailable due to lack of signals on Windows; Implementing a form of SIGTERM/SIGKILL may be possible in the future however |
ls | ✅ | ⚠️ | |
mkdir | ⚠️ | ⚠️ | |
more | 🛑 | 🛑 | Conflicts with the built-in DOS command (consider edit as an alternative) |
mv | ✅ | ⚠️ | |
pwd | ✅ | ⚠️ | |
rm | ✅ | ⚠️ | |
rmdir | ⚠️ | ⚠️ | |
sleep | ✅ | ⚠️ | |
sort | ✅ | ✅ | Integrated port of the original DOS command |
tee | ✅ | ⚠️ | |
timeout | 🛑 | 🛑 | Relies on kill’s functionality |
uptime | ✅ | ⚠️ | |
whoami | 🛑 | 🛑 | Conflicts with the built-in Windows command |
Windows caveats
| Difference | Detail |
|---|---|
| CRLF line endings | Windows text files often use CRLF (\r\n). Most utilities handle this transparently, but pattern matching with $ and exact byte counts can be affected. |
No /dev/null | Use NUL instead, for example find . -name "*.log" > NUL |
| No POSIX signals | Signals such as SIGHUP, SIGPIPE, and SIGUSR aren’t available. Ctrl+C (SIGINT) works as expected. |
| Path separators | Both / and \ are accepted. Some utilities produce \-separated output, which can affect downstream piping. |
| File permissions | Windows uses ACLs, not POSIX permission bits. Permission-based predicates (for example find -perm) may behave differently or be unavailable. |
| Symbolic links | Reading existing symbolic links works without elevation. Creating new symbolic links requires Developer Mode (Settings > System > Advanced) or an elevated terminal. |
PowerShell Command Parsing
The installer integrates itself with interactive PowerShell sessions via PSReadLine.
It ensures that quoted expression behave somewhat like they do under UNIX shells or CMD:
echo *.txt will then print a number of file names, while echo '*.txt' will print “*.txt” literally.
There are two shortcomings, however:
- PowerShell’s escape character is still
`, not\
While you may writefind . \( -foo -bar \)with Bash, you still need to writefind . `( -foo -bar `)in PowerShell. Get-Command ls,Get-Help ls, etc., will still showls, etc., as builtin commands
Due to limitations aroundPSNativeCommandPreserveBytePipewe cannot integrate ourselves in a more robust way with PowerShell.
Intentionally dropped
Commands that exist upstream but aren’t shipped here because they rely on POSIX-only concepts, would break existing Windows scripts, or simply aren’t useful on Windows.
dd: Perhaps useful in the future.dircolors,shred,sync,uname: Not particularly useful on Windows.chcon,chgrp,chmod,chown,chroot,groups,hostid,id,install,logname,mkfifo,mknod,nice,nohup,pathchk,pinky,runcon,stdbuf,stty,tty,users,who: POSIX-only concepts unavailable on Windows.
Contributing
Bug reports and pull requests are welcome. See CONTRIBUTING.md for details on the repo layout and how changes flow between this repo and the upstream uutils projects.
相似文章
@auspiceshirley: 已严肃安装 Coreutils for Windows,这下Codex应该能在Windows上跑通大部分Linux命令了
微软发布了Coreutils for Windows,为Windows提供原生Unix核心工具,使得Codex等工具可以在Windows上运行大多数Linux命令。
@ChrisWangwy: https://x.com/ChrisWangwy/status/2064589910485684254
微软发布了 Coreutils for Windows,将 78 个类 Unix 命令引入 Windows 原生终端,方便 AI Agent(如 Hermes、Claude Code)在 Windows 下直接使用 grep、ls 等命令,减少翻译开销。文章详细介绍了安装步骤、别名冲突和验收方法。
Coreutils for Windows
Microsoft 发布了适用于 Windows 的 UNIX 核心工具的原生构建,包括 uutils/coreutils、findutils 和 grep,打包为单个多调用二进制文件,以实现无缝的跨平台脚本编写。
WSL 容器、适用于 Windows 的 Coreutils 和代理
Microsoft 在 Build 2026 上宣布了面向 Windows 的新开发者功能,包括适用于 Windows 的 Coreutils、WSL 容器、智能终端以及用于安全代理执行的 Microsoft Execution Containers (MXC) SDK。
微软面向开发者的新版Windows进一步拥抱Linux
微软在Build大会上宣布了面向开发者优化的Windows 11体验,包括Windows版Coreutils(原生类Linux工具)、WSL容器(便于管理Linux容器)、集成AI的实验性智能终端,以及可快速配置的Windows开发者配置。