Introduction
On Windows, PowerShell is the standard shell, but when you let AI tools such as Claude do the work, they often try to run Unix commands (cat, rm, echo, and so on) as is. PowerShell sometimes has aliases with the same names, but their options and behavior differ, so the commands can fail.
Install GNU Coreutils for Windows, provided officially by Microsoft, and you can use Unix commands from Windows Terminal (PowerShell) in an almost native way.
Installation
1. Install with winget
No administrator rights needed. Open Windows Terminal and run:
winget install Microsoft.Coreutils
When the installation finishes, restart the terminal.
2. Check That It Works
Let’s try a few commands.
echo aaaa > a.txt
cat .\a.txt
aaaa
rm .\a.txt
It worked without problems. cat showed the file’s contents and rm deleted it.
Handy in Combination with AI
When you let AI tools such as Claude handle terminal work, they often generate steps that assume Unix commands.
For example:
cat <filename>to view a file’s contentsrm <filename>to delete a fileecho <text> > <filename>to create a file
With Coreutils installed, you can copy and paste the commands the AI generates and run them as is, so you get stuck on environment differences less often.
Even if you use PowerShell by default, the Coreutils commands take precedence. If one collides with a PowerShell alias, you can call the command by its full path or remove the alias within the session.
Summary
- A single line,
winget install Microsoft.Coreutils, installs the set of Unix commands cat,rm,echoand others work directly from Windows Terminal (PowerShell)- Commands generated by AI tools run on Windows without getting stuck
I recommend this setup if Windows is your main environment and you often hand work off to AI.
Related Posts
Launching Windows Terminal by Typing "terminal" on Japanese Windows 11
On Windows 11 in Japanese, typing "terminal" into Start search doesn't find Windows Terminal. Here's how to fix that by adding a shortcut to the Start menu.
I Measured Whether Turning Off Thinking Was OK, and It Was My Grader That Broke Twice
I had turned thinking off by default in my local LLM CLI. To back up a decision I'd made by looking only at speed, I measured accuracy, and it was the same. But on the way there, I hit bugs in the grading script I wrote myself twice.
I Had Three AIs Review 1418 Lines I Wrote, and They Found 11 Real Bugs
I had three reviewers, Claude, Codex and a local Qwen, review scripts I had written and been running myself. Three were bugs I couldn't have found on my own, and one was in the very script that tallies the review results. There was also a defect all three missed.