Same black box. Two different languages. Paste the wrong one and a perfectly good command becomes gibberish.
A copied-from-the-internet command — the kind every tutorial hands you — pasted straight into the Windows terminal. It should silence the noise. Instead: a parse error. The command isn't broken. It's in the wrong language.
"I copied the exact command from a guide. It just errored. I assumed I'd done something wrong — but I'd literally pasted what they told me to. How is the same command right in one place and wrong in another?"
"This one I get wrong myself — I'll hand over a clean Bash one-liner and forget you're in PowerShell, where grep and 2>/dev/null don't exist. It's not your error. It's mine for not checking which shell you're standing in before I gave you syntax for the other one."
On Windows you'll meet two terminals. PowerShell is the Windows-native one (the default). Git Bash is a Unix-style shell that comes with Git. They do the same kind of thing — run commands — but they speak different dialects. A command fluent in one can be a parse error in the other.
Windows-nativeGet-ChildItem, $env:VAR, backtick escapes, 2>$null. The default on every Windows machine.
POSIX / Unix-stylels, $VAR, forward slashes, heredocs, 2>/dev/null. What most online tutorials assume.
silent traphead / tail don't even exist in PowerShell 5.1. Same intent, different words.
Why this matters on day one: copy-pasting a command across shells is one of the most common "why won't this run" traps a beginner hits. The fix isn't more debugging — it's a single question asked first: which shell am I in? That tells you which dialect to use, and turns a baffling parse error into a non-event.
You pasted a command straight from a tutorial into PowerShell and got 'grep' is not recognized. The tutorial author swears it works. What's actually going on?
grep and 2>/dev/null are Bash; in PowerShell you'd use Select-String and 2>$null. The command was never broken — it was in the wrong language for the window.PS C:\> is PowerShell; a $ with a Unix path is Git Bash. Look before you paste.ls works in both by luck; grep/head/tail are Bash-only.2>/dev/null in Bash, 2>$null in PowerShell. Tiny, breaks loudly.Same rule as every module: answer it right, or it isn't done.
Before you debug a command that won't run, ask which shell you're in. "Right command, wrong dialect" is a translation problem, not a bug.
The side-by-side that ends the parse errors: the dozen commands you'll actually paste, in both dialects, with the gotchas marked (the ones that exist in only one). Keep it open while you follow any tutorial written for the other shell.