Linux to Windows command converter

How to use the Linux to Windows command converter

  1. Paste a Unix or Linux shell command into the left input — single line or multi-line, including line continuations with backslash.
  2. Pick the target shell: Windows CMD or PowerShell. CMD is the older command interpreter; PowerShell is more capable and closer to bash.
  3. The converted command appears live as you type. Common Unix utilities (ls, cat, grep, curl, find, etc.) are mapped to their Windows equivalents.
  4. Variable references (`$VAR`) are converted to CMD syntax (`%VAR%`) or PowerShell syntax (`$env:VAR`) automatically.
  5. Copy the converted output and paste into your Windows terminal.

When to use it

Useful for developers running cross-platform on Windows, copying tutorial commands from Linux blog posts, or rewriting CI scripts when migrating between runners. Alternative: WSL or Git Bash bypasses the conversion entirely by running real bash on Windows — use the converter when you need native CMD/PowerShell output (e.g., for batch files, IT scripts, or PowerShell automations).

Example

A typical curl request and its CMD equivalent:

# Linux
curl -X POST https://api.example.com/users \
  -H "Authorization: Bearer $TOKEN" \
  -d '{"name":"Alice"}'

# Windows CMD
curl -X POST https://api.example.com/users ^
  -H "Authorization: Bearer %TOKEN%" ^
  -d "{\"name\":\"Alice\"}"

Frequently asked questions

Why doesn't my converted command work in PowerShell?
PowerShell handles quoting and arrays differently from CMD. Re-check: are you using the PowerShell target (not CMD)? Are you piping output into PowerShell cmdlets that expect objects rather than text?
Does the converter handle line continuations?
Yes — Linux backslash (`\`) becomes caret (`^`) in CMD or backtick (` ` ` `) in PowerShell. The conversion is automatic.
What about Bash arrays and loops?
Simple for/while loops convert. Complex array manipulation, process substitution `<(...)`, and named pipes don't have direct CMD equivalents — the converter flags these and suggests PowerShell which has comparable features.
Can I convert PowerShell back to Bash?
Not in this tool — the conversion is one-way (Linux → Windows). For PowerShell-to-Bash, the closest equivalent is to read PowerShell docs and write the bash equivalent by hand.
Are environment variables converted correctly?
Yes: `$HOME` → `%USERPROFILE%` (CMD) or `$env:USERPROFILE` (PowerShell). Custom variables `$MYVAR` map to `%MYVAR%` and `$env:MYVAR` respectively.
Does the tool support 25+ commands?
Yes — the most common utilities are mapped: ls→dir, cat→type, grep→findstr, mv→move, cp→copy, rm→del, mkdir→md, rmdir→rd, touch→type nul >>, and many more.

Related tools

Last updated: 2026-04-27