Coreutils for Windows

(github.com)

178 points | by gigel82 3 hours ago

37 comments

  • pjmlp 3 hours ago
    > 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.

    Well this is not very satisfying, what about proving a way where it actually works without us having to guess where the failure root cause happens to be?

    • chasil 2 hours ago
      Fully-qualify the path to the target program, and it should be no concern.
      • pjmlp 2 hours ago
        What a great developer experience out of the box!
        • larkost 1 hour ago
          I was going to comment that any sort of script that you are using in multiple environments probably should have all of the paths completely written out. I usually try to do this myself as I have gotten burned by binaries from unexpected paths on new systems a number of times.

          But then I realized that the point of this project is to make it easy to write scripts that can be used on multiple OSs... and that is going to make fully-qualified paths possibly a nightmare. Anyone know if these get put at `/bin/`?

          • qrobit 1 hour ago
            On nixos they're not, there's a single executable in /bin -- /bin/sh, and a single executable in /usr/bin -- /usr/bin/env
      • LoganDark 2 hours ago
        A big part of the point is so you can use scripts made for other platforms on windows natively, which you lose when you have to alter them to pass absolute paths
        • chasil 2 hours ago
          Busybox helps you avoid this nicely on Windows. When you run one of one of its shells, it uses all it's own builtins in preference to anything external.

          Get the 64-bit version: "there's some advantage in using the 64-bit executable busybox64.exe. In particular, it can be quite a bit faster."

          https://frippery.org/busybox/index.html

          • LoganDark 2 hours ago
            Busybox is nice, but it's kind of like the Blender default cube to me: my only memories of it are removing it on sight to replace with something better.
        • d3Xt3r 1 hour ago
          It actually failed even before that. The project states "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.*"

          ... but they failed to provide a port of Bash - so how exactly do they expect someone to run a bash script in Windows "without translation"? If the answer is WSL, then there's no need to port the coreutils over because WSL distros already include them. If the answer is to port the scripts over to PowerShell, then you wouldn't want to call Windows coreutils in your PowerShell scripts and run into unexpected behaviour (and also lose out on the object manipulation advantages of PowerShell).

          And finally, they failed to port over commands that would actually be useful - like dd, for writing ISOs to a flash drive or backing up drives. chroot could've taken advantage of Windows' new sandbox feature to switch to a virtual C: drive. chown could've been an easier alternative to takeown/icacls. chmod could be used to remove the annoying network file blocks and also change file attributes and so on.

          This whole project seems like a half-assed attempt at nothing.

          • chasil 1 hour ago
            Bash itself is an odd duck in scripting, with some dark historical crevices: http://tiswww.case.edu/~chet/bash/POSIX

            A better option is a pure POSIX shell, the best-known of which in Linux is dash, but there is an existing Ada port to Windows here:

            https://github.com/AdaCore/gsh

            If non-POSIX features are required, the Android decision for mksh might suggest oksh for Windows.

        • justsomehnguy 1 hour ago
          Don't do the absolute paths. Do the environment.

          Maybe someone out there mixmashes PowerShell, bash, sh and cmd scripts from different platforms in one session - but usually it's one, quite straightforward 'flow' which requires a quite specific environment.

    • layer8 35 minutes ago
      How do you propose for this to be solved without breaking existing CMD batch files and PowerShell scripts and invocations by applications?
      • pjmlp 27 minutes ago
        The same way as cygwin, mingw?

        Start a terminal session where they come first in the PATH?

        That way one knows where they are getting into.

        • layer8 10 minutes ago
          Well, you can have that now? Where is the problem?
    • scoopr 1 hour ago
      Maybe it’s for the llm tool use PATH?

      That was the most plausible reason to even mention it, that I could think of.

    • ocdtrekkie 2 hours ago
      The best part is the reason it conflicts with a lot of PowerShell is PowerShell shimmed Linux commands over to their Windows equivalents for years even though the flags were different.

      So ls in many systems will match the behavior of dir, and only accept the flags for dir. But if you use a system with the newer coreutils release here, ls will expect ls flags!

      • zanecodes 1 hour ago
        Not that it detracts from your point, but PowerShell defined Linux-like aliases for PowerShell commands, not the old CMD.exe binaries.

        So ls would actually match the behavior and accept the flags for Get-ChildItem, not dir.

  • jakegmaths 3 hours ago
    Windows really needs to ditch CRLF and just use LF, and switch from backslashes to forward slashes. Or better yet, just switch everything to full POSIX.

    In powershell everything is much better than cmd, but it's just not enough.

    WSL is generally great, but there are annoying downsides. I often get "catastrophic" crashes and the zone identifier files drive me nuts. Plus it takes so much longer to start VSCode when connecting with WSL, and now you've got two file systems. WSL1 was in many ways better than WSL2 for these reasons.

    • chasil 2 hours ago
      Windows is also a rare bird in UTF-16.

      "UTF-16 is used by the Windows API, and by many programming environments such as Java and Qt. The variable-length character of UTF-16, combined with the fact that most characters are not variable-length (so variable length is rarely tested), has led to many bugs in software, including in Windows itself.

      "UTF-16 is the only encoding (still) allowed on the web that is incompatible with 8-bit ASCII. It has never gained popularity on the web, where it is declared by under 0.004% of public web pages (and even then, the web pages are most likely also using UTF-8). UTF-8, by comparison, gained dominance years ago and accounted for 99% of all web pages by 2025."

      https://en.wikipedia.org/wiki/UTF-16

      • bvanheu 5 minutes ago
        > Windows is also a rare bird in UTF-16.

        an interesting tidbit, some Windows kernel developer realized that most registry keys are ascii anyways so they could save up to 50% space simply by storing the name as ascii. The flag is called "compressed name" and they will pad with 0x00 when reading the name to make a proper utf-16 string.

      • 0x1d7 1 hour ago
        NT shipped with USC-2 as UTF-8 (and -16) did not yet exist. USC-2 naturally translated to UTF-16, hence the choice. NT/Win32 is also designed for fixed-with code units, something UTF-8 doesn't support.

        You can use UTF-8 on a per-application basis, within limits.

        https://learn.microsoft.com/en-us/windows/apps/design/global...

        Conversely, UEFI is UTF-16 only, thanks to Windows.

        UTF-8 only would be an ABI breaking change, so that's not going to happen. We don't want the NT kernel to end up like Linux, after all :-)

        • yjftsjthsd-h 1 hour ago
          > UTF-8 only would be an ABI breaking change, so that's not going to happen. We don't want the NT kernel to end up like Linux, after all :-)

          I think you're making a joke, but it still doesn't make sense. Linux does avoid breaking changes to its userspace ABI

      • zahllos 2 hours ago
        Additional Detail: it is specifically utf-16 little endian when a byte order mark is not used, which is the opposite of the recommended choice of big endian in the RFC.

        Worse are the byte order marks required to support both endians that end up in files.

        • layer8 21 minutes ago
          The development of Windows NT based on UCS-2 precedes the RFC by roughly a decade, and little-endian was the natural choice for the Intel PC platform. Obviously the endianness had to remain the same when UCS-2 was extended to support UTF-16.
      • wvenable 1 hour ago
        > Windows is also a rare bird in UTF-16.

        Web browsers use UTF-16 internally. So Windows isn't even largest "platform" that uses UTF-16.

      • Dwedit 2 hours ago
        UTF-16 is also used by C#, Java, and JavaScript. Since JavaScript is so widely adopted, I wouldn't call it a rare bird. Not necessarily used when reading or writing files, but it's what's used internally for the strings. As a result, your strings use UTF-16 surrogate pairs to represent characters outside of the basic multilingual plane (such as Emoji).
    • Night_Thastus 13 minutes ago
      "Windows really needs to ditch CRLF and just use LF, and switch from backslashes to forward slashes."

      Hahahahaha. That's hillarious.

      Oh god, you're serious?

      Do you have any idea how much of Windows, and user software would break? Any idea at all?

      You really want MS, who has built backwards compatibility as a core feature of Windows, to break countless thousands of pieces of software that run on it?

      I'm sure there's some idealized fantasy in which that change gets wrapped in a neat little abstraction that prevents anything from breaking. I promise you, there is no way of encapsulating or abstracting that change that works for everyone.

      If I could wave a magic wand and make it so without breaking it, I would. But it's a fantasy.

    • pjmlp 2 hours ago
      No worries, eventually Xenix will make a comeback.

      You cannot ditch CRLF, Microsoft isn't Apple.

      Windows accepts backslashes and forward slashes, only old applications that manually search for one of them get it wrong.

    • 0cf8612b2e1e 2 hours ago
      Most (everything?) on Windows actually works with forward slashes. However, much of the tooling will overwrite your version with a backslash wherever it can.
      • badc0ffee 1 hour ago
        At which layer? dir /w, for example, is never going to list the contents of \w.
        • recursive 49 minutes ago
          Use powershell.

          Get-ChildItem /w

    • cardboard9926 3 hours ago
      Don't think this will ever happen, especially since this is Microsoft you are talking about [0]

      [0] https://www.youtube.com/watch?v=bC6tngl0PTI

    • EvanAnderson 2 hours ago
      > ... Or better yet, just switch everything to full POSIX.

      Interix[0] did a pretty good job of this, but MSFT killed it. I was compiling GNU tools w/ GCC and running bash under Interix back in in 2000 under Windows 2000. It was grand.

      [0] https://en.wikipedia.org/wiki/Interix

      • dekhn 2 hours ago
        I ported a million-line, OpenGL/Motif application using Interix (before it was acquired). Indeed, it was grand.
    • rfgplk 3 hours ago
      > Or better yet, just switch everything to full POSIX.

      Really not possible as most of POSIX semantics arise naturally from the kernel (or are enforced/executed at the kernel level). Windows technically provides some of them (or semantic equivalents) so you could make something work, but in order to do a full port you'd need to strip out too many concepts for it to be worthwhile. For instance the idea that "everything is a file" or the single root filesystem layout (which iirc is segmented deeply at the kernel level).

    • Grom_PE 3 hours ago
      On Windows, I've mostly avoided CRLF by configuring text editors and git to use LF, and writing text files in binary mode.

      The only places that still forced CRLF were batch files and clipboard.

      • layer8 17 minutes ago
        A lot of tooling that generates or transform text-like files (e.g. XML) outputs native line endings, which in case of Windows is CRLF. Depending on what you do, it’s almost impossible to avoid that.
      • wnevets 2 hours ago
        > I've mostly avoided CRLF by configuring text editors and git to use LF,

        That has been my experience as well. I can't remember the last time I had an issue related to CRLF.

        • pipes 2 hours ago
          Yesterday for me was the last time. Visual studio 2026 default to crlf I think maybe and I have autoctlf in git turned off. I should probably turn that back on.
    • fg137 2 hours ago
      They might as well create a new OS with a different name, because none of the existing applications will work, and no enterprise customer will use it.
    • saidnooneever 3 hours ago
      honestly your point is a bit weird.

      powershell is good. its much better than unix's everything piped is Text idea. godawfull that. outputs being objects is a really solid take.

      WSL is trash.

      besides that, lf vs. crlf is silly as you mention but crlf is more logical considering what its implementing. that being said the notion of these control chars is already based on outdated and limited ideas.

      if you want a consistent system to do things with dont pick a system which tries to be two systems.

      Linux has wine. Windows has WSL.

      I'd recommend BSD. any flavor will do.

      might take some adjustments but you will have a more 'rational' system if that is what you desire.

      (otherwise, embrace the madness!)

      • thewebguyd 2 hours ago
        > outputs being objects is a really solid take.

        Glad I'm not alone here ha!

        Being able to go someoutput | Format-Table | Select ColumnName,ColumnName,CloumnName is great. Beats memorizing the output format of any specific command and trying to wrangle it with awk.

        • ACS_Solver 1 hour ago
          I'm a big Linux advocate with limited experience on modern versions of Windows, but PowerShell objects are great. So is the Unix way of doing text. I think the strengths of each approach are in different use cases. Unix style is better for interactive usage because it's fast, I can type df -h | grep /home very quickly. Object output is better for scripts that can, thanks to objects, store and operate on sensible data while Bash scripts do a lot of ad-hoc data extraction/reformatting with string expansion, awk and whatever else to get data to the next step in the script.
        • d3Xt3r 2 hours ago
          You can skip the `| Select` btw.

          Just do `someoutput | ft ColumnName,ColumnName,CloumnName`

      • throwaway613746 2 hours ago
        [dead]
    • aniceperson 3 hours ago
      the two filesystems can be a super power... i seamlessly use the same driver between wsl2 and my dual booted opensuse.
      • thewebguyd 3 hours ago
        Yeah I don't mind/like the two file systems. Looks like MS is taking it further too they also announced WSL Containers & API.
    • forrestthewoods 1 hour ago
      I have absolutely zero sympathy for any tool that is incapable of handling \r\n and only works with \n. Literally absolutely no sympathy.

      All software accumulates warts over time. Linux is overflowing with horrible warts and tech debt. As is any software that has successfully served customers for decades.

      But multiple line endings are quite possibly the easiest most trivial thing to support and there is absolutely no negative cost of any kind in doing so. Linux ecosystem chooses to be stubborn and provide a strictly worse user experience out of pure spite and for zero user benefit. It’s very irritating.

      • yjftsjthsd-h 1 hour ago
        > But line endings are quite possibly the easiest most trivial thing to support and there is absolutely no negative cost of any kind in doing so. Linux ecosystem chooses to be stubborn and provide a strictly worse user experience out of pure spite and for zero user benefit. It’s very irritating.

        The Linux ecosystem handles it fine (by using a single standard). Windows doesn't. That's its problem.

        • forrestthewoods 55 minutes ago
          Comments like this really make me wish HN allowed you to block users. Alas.
          • yjftsjthsd-h 20 minutes ago
            If you have something to say, say it. This is barely even an ad hominem.
        • justsomehnguy 59 minutes ago
          > The Windows ecosystem handles it fine (by using a single standard). Linux doesn't. That's its problem.

          It's always funny to see how the fanbois treat their way as the one and only 'True Way'.

          • yjftsjthsd-h 26 minutes ago
            I didn't say it was the one and only True Way. My intended meaning - which I admit I may have poorly conveyed - is that tools from the unix ecosystem are intended to work on unix conventions, and do, and that works. Windows has different standards, which is also fine, but it follows that you shouldn't expect unix tools to follow Windows standards even if you make them run on Windows. This is like getting Windows software to run under WINE and then complaining that it doesn't use /n newlines and that it should change to accommodate Linux (or whatever). No, a Windows program will follow Windows standards even when made to run on a unix-like. And in the same way, unix-family software is going to follow unix standards even on Windows.
    • weregiraffe 3 hours ago
      >Windows really needs to ditch CRLF...

      Windows needs to ditch itself.

    • avidphantasm 2 hours ago
      No, they need to ditch drive letters first. The NT kernel and NTFS don't even require them (I used to mount disks without drive letters back in the NT 4 era). They just don't care enough to get rid of this annoyance.
      • Dwedit 2 hours ago
        Nobody wants to use \??\GLOBALROOT\Device\HarddiskVolume3\ in their paths.
      • noselasd 2 hours ago
        users , especially non-technical, find it highly useful in my experience. Is it a net positive to get rid of them, or will it largely only make developers happier ?
  • dataflow 3 hours ago
    So dir is not shipped due to conflict with built-ins, echo and rmdir are shipped despite conflicts, and sort is deemed not to have a conflict? What is the logic?
    • layer8 12 minutes ago
      My guess is that some commands are compatible because they behave the same on both systems when used without command line options, and the implementation can distinguish between DOS and Unix options.
    • pjmlp 3 hours ago
      No idea, this is broken at start, I would expect at least a reasoning on how they expect to improve the mess going forward.

      Otherwise just don't do it, if it is going to be a mess to work with.

      • rfgplk 3 hours ago
        There's almost no point to this, especially since they're already shipping a (strictly) limited subset with the reasoning "not useful on Windows" despite Windows equivalent facilities _clearly_ existing. They should have at least considered a full native port.
        • trinix912 36 minutes ago
          They've already made a few attempts over the years (Windows Subsystem for UNIX comes to mind), neither really caught on, except WSL.

          I also don't quite get why one would want such a setup - why not just use MSYS2 or WSL? As it is, it's just a mishmash of CMD builtins, Windows utils, Powershell, and these Coreutils. Will one have to use CMD-style (%var%) variables or will it be the POSIX way ($var)? Also just keeping in mind when to use /s or -s style switches, which version gets invoked depending on the PATH, PS aliases, etc. is just a lot of mental overhead for seemingly little advantage over WSL.

        • lhecker 1 hour ago
          I apologize for asking, but did you also understood the "Shell conflicts" section as being the complete list of utilities? The project ships the majority of core utilities (~75%).
        • pjmlp 3 hours ago
          This smells like someone promotion to get the stuff shown at BUILD, like the old sudo as runas replacement, which I don't care it exists.

          "Yo make some UNIX stuff to show at BUILD as developer tools".

      • fg137 2 hours ago
        Users might as well just use msys2.
    • lhecker 2 hours ago
      As hex4def6 said, the idea was that DOS command conflicts are not a good idea, while overriding PowerShell builtins in interactive sessions (PSReadLine) is acceptable, if not a good idea. We open-sourced DOS sort and published a port of the DOS find command. The suite then dispatches to the GNU/DOS variant based on heuristics.
    • 201984 3 hours ago
      AI said to do it.
    • hex4def6 3 hours ago
      I think if it conflicts with a CMD command it's not shipped, but if it conflicts with a powershell command it's ok.
  • fabiensanglard 3 hours ago
    I wonder if the motivation is to make Ai agents work better on Windows?
    • lhecker 2 hours ago
      The intent was simply to give people coming from macOS and Linux more of the CLI tools they're familiar with. In other words, agents weren't the focus at all. But if it ends up helping them, that's a good added benefit of course.
      • penguin_booze 1 hour ago
        Could come pre-installed with cygwin instead.
        • okanat 1 hour ago
          Cygwin isn't native Windows. Cygwin does many unholy things to enable signals and fork syscall in binaries.

          uutils enables fully Windows native commands in the subset of system calls and disk structure Windows supports.

    • FergusArgyll 3 hours ago
      For sure. I wonder how long until the agents learn about this though. At least a year, right?
      • eksu 2 hours ago
        Agents / models don't need to "learn" about this.

        When on Windows, the models default to bash / coreutils conventions until they realize it doesn't work / not available unless explicitly instructed otherwise.

        Even on Mac, they tend to default to bash instead of running things in zsh.

      • GMoromisato 3 hours ago
        Or you can tell your agent about it in one line of AGENTS.md.
      • ex1fm3ta 3 hours ago
        nope. With ClaudeCode you can create skills ( basically markdown instructions) to teach your agents what command to use. You can also update CLAUDE.md to inject custom instructions that are feeded anything ClaudeCode is started.
        • jayd16 3 hours ago
          If that was sufficient wouldn't it just be easier to map to the Powershell commands directly?
          • AgentMasterRace 1 hour ago
            Claude code (at least the cli) has this, their code leaked so you can see their extensive (1000+ LOC) PowerShell took script.
  • EvanAnderson 3 hours ago
    I would have liked to see head, tail, tr, uniq, and cut. I end up dragging over the old "gnuwin32" versions of those to a lot of Windows machines. Those are my go-to tools for quick-and-dirty log analysis.

    I know I could use Powershell for those kinds of tasks, and I certainly do make a lot of use of Powershell, but the familiarity of those simple tools and the decades-old "muscle memory" of using them on various Unix, Linux, and Windows boxes makes them hard to ditch.

    • lhecker 2 hours ago
      > I would have liked to see head, tail, tr, uniq, and cut.

      The project includes all of those. Or were you talking about the past?

      • EvanAnderson 2 hours ago
        I'm a gigantic idiot who can't read. I was reading the table shell conflicts as all the included commands, and not just as a subset of commands that had shell conflicts.

        A gigantic idiot. Sorry.

    • ex1fm3ta 3 hours ago
      I use those commands also to filter output and fee ai agents with that. Tail and Head are my favourites to avoid wasting tokens. Wayy too many fancy build logs messages.
    • NetMageSCW 3 hours ago
      Windows has lacked decent ports of recent GNU tools for a while. I still use some very old ones. It would be great if MS worked on the other tool groups like textutils.
  • signal11 2 hours ago
    For the MS folk reading this: native zsh on Windows, please?

    WSL2 is great, but native POSIX is even better. Of course it’s a big undertaking, but it makes Windows a first-class dev platform for those who need POSIX in production.

    • 0x1d7 1 hour ago
      The NT kernel could never implement full POSIX semantics. It would have to be another UN*X clone to do so.

      And that would suck.

      • yjftsjthsd-h 1 hour ago
        Surely WSL1 proves that it mostly can
  • fdefilippo 3 hours ago
    https://frippery.org/busybox/

    winget install -e --id frippery.busybox-w32

    • chasil 2 hours ago
      From the site, "there's some advantage in using the 64-bit executable busybox64.exe. In particular, it can be quite a bit faster."
  • EvanAnderson 3 hours ago
    I feel like I'm seeing an error, or I just don't understand what they mean w/ "find" and "Integrated port of the original DOS command" and not listed as conflicting.

    There's a "%SystemRoot%\System32\find.exe" on every Windows NT-derived OS. That's absolutely a conflict.

    Also, the "find" command from "findutils" is in no way functionally similar to the "original DOS command" (which is for finding text in files).

    Aside: Eschew "find.exe" on Windows for "findstr.exe". The latter is vastly more efficient. I discovered that by happenstance once and have trained my hands to type "findstr" when I mean "find" on Windows.

    • lhecker 2 hours ago
      We actually open-sourced DOS sort and published a port of the DOS find command. The suite then dispatches to the GNU/DOS variant based on heuristics. The installer allows you to pick what variant to use by default if the invocation is ambiguous.
    • RachelF 56 minutes ago
      Don't use find, use Voidtools' Everything. It finds filenames instantly, by searching the NTFS structures.

      This is one of the few features that Linux file systems do not have.

    • capitol_ 1 hour ago
      Why not use ripgrep?
      • EvanAnderson 1 hour ago
        I'm working with mostly "cattle"-type boxes with only the stock OS components installed so I "live off the land". On boxes that I treat as "pets" I do load other tools. A Win32 port of GNU grep has done well enough for me that I've never thought to look at ripgrep.
  • ilotoki0804 2 hours ago
    You can install gnu-compative shell commands when installing git for Windows. It even includes useful unix utilites like bash, so check it out if you're interested.

    More project information: https://gitforwindows.org/

    Official download: https://git-scm.com/install/windows

    • spider-mario 2 hours ago
      Or MSYS2, to go even further. https://www.msys2.org/
    • pipes 2 hours ago
      Always wondered if git bash was cygwin, I don't think it is, but it seems very similar.
      • okanat 12 minutes ago
        Git Bash is an MSYS2 environment that ships `bash.exe`. The rest of the Git-for-Windows executables are native Windows executables compiled with Mingw-w64 (aka GCC for Windows). Except for Bash nothing runs under POSIX simulation provided by MSYS2 runtime. MSYS2 runtime is a fork of Cygwin.

        I explained the differences here: https://news.ycombinator.com/item?id=48375716

      • rzzzt 1 hour ago
        Cygwin executables need cygwin1.dll to run while MSYS-based distributions are using Windows APIs directly. One major difference is around process management: in Cygwin fork() is implemented* while MSYS2 packages will need to use whatever the NT kernel provides (i.e. also need to modify the source to build for this target): https://stackoverflow.com/questions/985281/what-is-the-close...
        • okanat 27 minutes ago
          You're conflating MSYS2 with Mingw-w64. MSYS2 installation comes with multiple environments/ABIs and MSYS2 mode is actually a fork of Cygwin. They fork Cygwin, put some patches on and rename the DLL as msys-2.0.dll . Here is the sources for MSYS2 runtime that produces it: https://github.com/msys2/msys2-runtime . To run bash you need termios API, stty, fork, exec and signals (and some other POSIX-specific funtions).

          Due to Windows's execution model it is not possible to natively implement fork. Cygwin implements those via a executable backdoor hack. Basically the executable starts executing from the usual start point and it receives where to jump via a named pipe. Since MSYS2 is a fork it uses the same implementation.

          Unlike Cygwin, MSYS2's goal isn't to be a complete system but ship just enough tooling to enable development with Mingw-w64. Mingw-w64 is the toolchain that ships GCC and it also defines its own ABI where the C ABI is the same as MSVC / Win32 ABI except that Mingw-ABI comes with its own threading and structured exception handling infrastructure. For C++ Mingw-w32 uses Itanium ABI instead of MSVC. If you use GCC to compile the debugging symbols will be DWARF with Mingw-32.

          You can also use Clang environments where you can generate PDB debug symbols and use native Win32 threading.

          Except for the differences above, the executables targetting Mingw-w64 ABI are normal native Windows executables. They don't have access to most of the unistd.h and they have to use native Windows system calls (kernel32.dll user32.dll, ucrt etc.)

          You can target MSYS2 / Cygwin ABI too (just like Bash). In this ABI the entire system works like a POSIX system. Unlike Mingw-w64 backslashes are not native. In MSYS2-ABI programs execute very slowly compared to purely Mingw-w64 executables since they always have to pass the POSIX emulation layer.

          • rzzzt 25 minutes ago
            I did forget about these! The installer will add separate launchers for each style of environment.
      • Thoreandan 1 hour ago
        Close, it's MinGW/msys - different pathname semantics and under-the-hood approaches.
  • NewsaHackO 3 hours ago
    In the intentionally dropped section, it lists shed as "Not particularly useful on Windows." Does anyone know why? Is thre already a shred-like command in Windows?
    • Octoth0rpe 14 minutes ago
      The one in that section that kills me is the lack of `uname`. So you build a bunch of posix-compatible stuff, note that some things will be missing and some work slightly differently. It sure would be nice if we had a standard way of telling which kind of system you were on then, WOULDN'T IT?? (a very common use case for uname)
    • rzzzt 1 hour ago
    • Dwedit 2 hours ago
      Shred isn't very useful on SSDs in general. Because of TRIM, deleting a file instantly makes the sectors read back as 00 bytes. (Yes the data is technically still on the flash chips scattered across memory blocks without any mapping telling you where each piece of the data is, but is not readable through normal drive commands)
    • neskorodev 3 hours ago
      From shred man:

      The shred command relies on a crucial assumption: that the file system and hardware overwrite data in place.

      ...

      many modern file system designs do not satisfy this assumption. Exceptions include:

      ...

      Log-structured or journaled file systems, such as.

      ...

      NTFS.

      • andai 3 hours ago
        I think SSDs also randomize where data ends up? But I'm not sure if that's true for existing files too.
        • orev 3 hours ago
          Yes. All of the assumptions made with shred and sdelete apply only for spinning HDDs. SSDs require different methods of wiping.
          • FergusArgyll 3 hours ago
            Is there no way to track down where the data actually lives?
            • orev 3 hours ago
              It depends on the firmware running on the SSD, so theoretically it’s possible but practically it’s not. Instead, SSDs use a special command to zero all cells on the chip at once, so it’s all or nothing. You can’t target specific files.
              • wtallis 2 hours ago
                To clarify: the host can issue a command to the SSD to securely wipe the whole drive including spare area that is not directly accessible to the host. The SSD controller in the drive issues erase commands to the NAND to erase individual erase blocks, with typical sizes on the order of 16MB.

                The SSD controller does not usually keep a history of where older versions of a block of data were stored, so it's not practical to erase an individual file and catch any partial older versions that may not yet have been garbage collected.

        • wtallis 3 hours ago
          The filesystem may choose to store new data at different logical block addresses than older versions. The SSD will definitely choose to store those newly written blocks at different physical addresses, both for the sake of wear leveling and for performance, because a read-erase-rearite cycle on an entire NAND flash erase block (several MB at minimum) is a very slow operation.
    • ChocolateGod 3 hours ago
      I assume it requires something exposed by the underlying filesystem.
      • kmeisthax 3 hours ago
        No. Shred will "work" - as in, compile, run, and have the expected logical effects of ultimately removing the file from the directory index - on any filesystem backed by any block device. The problem is that overwriting any part of a file is not guaranteed to actually erase the overwritten data. Actually, it never has been; shred is kind of a hack that assumes an overwriting file system driver and a block device dumb enough to not remap sectors writing to media that's intrinsically erasable. e.g. try running shred on a mounted CD-R and see how far that gets you.
  • xnx 2 hours ago
    Cool. I'm already using cygwin for a lot of these utilities. Would the Microsoft versions have any advantages?
    • chasil 2 hours ago
      No .DLLs would be the primary reason.
  • omoikane 1 hour ago
    • lhecker 1 hour ago
      Any command not listed under the "Shell conflicts" section is included. In my testing `ln` works great.
  • dovholuknf 3 hours ago
    FINALLY. This is actually exciting to me... Mind you the linux ports (cygwin, msys2, git bash) are all great to have and I make sure one version or the other is always on my path but having MS maintain them (assuming they continue to do so) is great news
  • 201984 3 hours ago
    There's also a windows port of busybox if you want something more stable. w64devkit uses it.

    https://github.com/rmyorston/busybox-w32

    • NetMageSCW 3 hours ago
      Not similar at all - too heavy weight when you just want to use a small tool.
      • d3Xt3r 2 hours ago
        How the heck is a portable 637KB .exe that doesn't require any installation, extraction or admin rights to run, "too heavy weight"?
      • chasil 2 hours ago
        This one might interest you, although it's quite old.

        https://unxutils.sourceforge.net/

        Busybox's shell is ash, but the above set includes an old zsh IIRC.

        Note also that the Frippery Windows busybox is available as a 64-bit version, in case 2gb is not enough (easy with some big awk associative arrays).

  • natas 3 hours ago
    No thanks, I'd rather use linux.
  • Dwedit 2 hours ago
    Will we ever see a Windows-optimized version of unix utilities that avoids creating new processes? It seems like that's the step that's really slow, and if you could reuse a process to continue running more commands, that would speed things up a lot.
  • Havoc 3 hours ago
    Nice. I appreciate the effort to make things less painful for powerusers. I had noticed some of these working already in PS.

    If anyone from MS is reading this can we please also get an equivalents (or even alias) for the thing that shows IP address? The windows equivalent of "ip a" is some convoluted PS command that I can never remember

    • thewebguyd 3 hours ago
      in PowerShell there is a built-in alias.

      > gip

      You could also make your own alias if you specifically want to type "ip a" just add a powershell function to your $PROFILE. function ip { param($argument)...." etc. have it call Get-NetIPAddress, else fallback to ipconfig.

    • NetMageSCW 3 hours ago
      ipconfig works pretty well.
  • dekhn 1 hour ago
    Linux: first they laugh at you, then it embraces, extends, and extuinguishes Windows.
  • thedumbname 3 hours ago
    Microsoft provides an awesome problem-solving solution, and 0 of the 6 problems they listed in the 'Windows caveats' section are solved.
  • testdelacc1 3 hours ago
    A fair question is why this fork of coreutils is required when the original Rust rewrite (https://github.com/uutils/coreutils/) supports Windows, in addition to Linux, macOS and wasm.

    The reason seems to be a few windows specific fixes (https://github.com/uutils/coreutils/compare/main...microsoft...) which can probably be upstreamed into the main repo.

    • NetMageSCW 2 hours ago
      So “supports Windows” doesn’t mean supports Windows.
    • hootz 3 hours ago
      Apparently the creator of the fork is also a maintainer of some uutils repositories.
    • egorfine 2 hours ago
      The original one is not virtue signaling enough
  • aniceperson 3 hours ago
    they should give up on the backwards slash.
  • egorfine 2 hours ago
    Yeah, we don't hate this uutils (NOT coreutils) project enough.
  • p-t 3 hours ago
    Is this only on windows 11 or does it support 10 as well? (i cant access the site rn because of wifi)
    • Someone1234 2 hours ago
      Windows 10 is end-of-life; so the question itself is odd. It may work on Windows 10, but they definitely don't support an EoL version of their OS.
    • lhecker 2 hours ago
      It should work on Windows 10. If you're using PowerShell, you do need to have v7.4 or later installed, however.
  • gigel82 3 hours ago
    Native Coreutils for Windows is genuinely some good news coming from Microsoft.
    • zamadatix 3 hours ago
      The command line team has been doing some solid work for a while. I recognize lhecker from the also great wt & edit projects.

      If you told me during the Windows 7 era the Windows CLI would not only be getting nice but getting pretty comfortable I would never have believed it.

      • thewebguyd 3 hours ago
        Yeah, the problem with Windows isn't the command line team, the problem is the marketing & sales div using windows to push every other MS service.

        If they just kicked them out and left the Windows div alone it'd be a decent OS. All the bones are there.

      • xeonmc 3 hours ago
        Hopefully these do not require a PhD to be implemented.
    • cute_boi 3 hours ago
      With these AI agents using lot of linux commands, I think they have to do it.
    • egorfine 2 hours ago
      It's not coreutils. It's a rust slop.
      • jeff_carr 1 hour ago
        Christ. I'm guessing it's to be BSD so they can pull it back and keep it proprietary at any time also. Never trust Microsoft to act in good faith. We USE THE GPL for a reason.
        • thewebguyd 1 hour ago
          Ubuntu also replaced GNU coreutils with uutils recently, its not just Microsoft.

          The project will deny it, but this is clearly an attack against the GPL

  • rfgplk 3 hours ago
    Isn't this just a restricted uutils fork? With most functionality culled for no good reason? "uname isn't useful on Windows" how? OSName/ Build numbers / systeminfo all exist?
  • spidercat 2 hours ago
    What does this do that Cygwin doesn't?
    • okanat 5 minutes ago
      Cygwin is like Wine. It fully emulates POSIX and puts a filesystem and syscall emulation layer on top and even an emulation for `/dev`. uutils are strictly limited to what Windows provides natively.
    • stronglikedan 2 hours ago
      this conflicts with native shell utilities of the same name - take that, cygwin!
  • hs86 3 hours ago
    Would it make sense to add a prefix to all commands to avoid conflicts with built-in commands? Like how, on macOS and FreeBSD, installing GNU Coreutils adds a `g` prefix, Microsoft could add an `m` prefix to these commands.
  • dizhn 2 hours ago
    Is 'dir' a Linux command?
  • asveikau 3 hours ago
    I just have msys on my PATH.
  • shevy-java 2 hours ago
    That's actually a good idea. Now, I am a Linux person, but I have windows on a secondary machine. Compiling on Linux is trivial.

    On Windows it is possible of course, WSL, msys, what not, but it is cumbersome. And I hate the default compiler on windows. So if coreutils on windows helps simplify all the base toolchain, I am all in favour of it. Windows really needs to make compiling stuff a LOT easier by default. I don't want to download some x GB of stuff I don't really need.

  • doctorpangloss 2 hours ago
    Busybox for Windows is the best implementation of coreutils for it, far and away. The maintainer is also very knowledgeable and responsive and actually merges community PRs which is incredible. Microsoft isn't going to do that, so why bother? Microsoft's solution will be a hot buggy mess that needs its own workaround and quirks day 1.
  • adzm 2 hours ago
    [dead]
  • rvz 3 hours ago
    Exactly. The best Linux distro is Windows.
    • FergusArgyll 3 hours ago
      The case for that statement (if there's a case at all) is wsl. This is outside wsl.
  • raggi 3 hours ago
    uutils coreutils was/is already available and more complete than this
  • natas 1 hour ago
    100% vibe coded.
  • throwatdem12311 3 hours ago
    Was not expecting EEE for Coreutils but I suppose it’s the natural consequence of the MIT license used for uutils so not totally unexpected.

    It’s annoying enough to support the differences between BSD and Linux, and now Linux has GNU and uutils, and now we’re gonna need Windows variant of uutils…ugh.

    • rvz 3 hours ago
      It was really obvious.

      Microsoft "loves" Linux for years and the entire point was to bring the Linux userspace on the Windows Desktop.