Translate a command between shells
Paste any common shell command and see its equivalent in bash, zsh, fish, PowerShell, or cmd. Powered by 204 regex mappings — runs entirely in your browser, no signup, no AI.
How it works
- Pattern-matched, not LLM-generated. Each rule is a regular expression with a hand-written output template. Predictable and deterministic — the same input always produces the same output.
- Both directions. Translate bash → PowerShell or PowerShell → bash, plus every other pair across the five supported shells.
- Flag-aware. Rules recognize common flag variants (e.g.
ls -la,rm -rf,grep -ri) and map each to the target's idiomatic equivalent. - Honest about gaps. When a command has no clean target-shell equivalent (e.g.
chmod +xin PowerShell), the translator says so instead of inventing a fake rewrite.
Example translations
A few patterns the translator recognizes out of the box. Try them in the box above.
grep -r "TODO" .Get-ChildItem . -Recurse | Select-String -Pattern "TODO"ls -la /tmpGet-ChildItem /tmp -Forcetail -n 100 app.logGet-Content app.log -Tail 100rm -rf node_modulesRemove-Item node_modules -Recurse -ForceGet-Processps auxtaskkill /f /pid 1234kill -9 1234Supported commands (39)
Commands the translator currently has at least one rule for. Each links to its full per-shell reference.
- awk
- cat
- cd
- chmod
- chown
- cp
- curl
- diff
- file
- find
- grep
- gzip
- head
- jobs
- kill
- ls
- mkdir
- mv
- patch
- ping
- ps
- pwd
- rm
- rsync
- scp
- sed
- sort
- ssh
- stat
- tail
- tar
- tee
- top
- tr
- uniq
- wc
- wget
- xargs
- zip
Plus rules for shell built-ins and other tools not yet documented as full pages — env, export, echo, alias, which, clear, whoami, hostname, uname, uptime, groups, id, exit, date, history, man, touch, less, more, df, du, sleep, seq, yes, watch, ln, readlink, basename, dirname, ssh-keygen, systemctl, apt, brew, nslookup, dig, traceroute, ifconfig, ip, ss, lsof, nc, sha256sum, md5sum, base64, nl, pgrep, nohup, crontab, and shell redirection / heredoc forms.
All translation rules
Every rule, grouped by canonical command. Each entry shows the operation the rule recognizes and the canonical bash form.
- awk5 rules
Print column N of whitespace-separated input
bash$1 | awk '{print $$2}'Print the running line number
bash$1 | awk '{print NR}'Print the number of fields per line
bash$1 | awk '{print NF}'Print lines that match a regex (awk-style)
bashawk '/$1/ {print}' $2Pattern-action language (awk has no single PowerShell equivalent)
bashawk
- cat2 rules
Print file contents
bashcat $1cat heredoc — no single one-liner in PowerShell (use a here-string `@" ... "@`)
bashcat <<$1
- cd4 rules
Change to home directory
bashcd ~Move up one directory
bashcd ..Return to previous directory
bashcd -Change directory
bashcd $1
- chmod4 rules
Make a file executable
bashchmod +x $1Set file mode to 755 (owner rwx, group/other rx)
bashchmod 755 $1Recursively set numeric file mode
bashchmod -R $1 $2Adjust permission bits with symbolic mode (u/g/o + r/w/x)
bashchmod $1 $2
- chown2 rules
Recursively set file owner
bashchown -R $1 $2Set file owner
bashchown $1 $2
- cp2 rules
Copy a directory recursively
bashcp -r $1 $2Copy a file
bashcp $1 $2
- curl4 rules
Download a URL to a specific file
bashcurl -o $1 $2Download a URL, keeping its remote filename
bashcurl -O $1Send a POST request with body
bashcurl -X POST -d "$1" $2Fetch a URL
bashcurl $1
- diff2 rules
Unified diff between two files
bashdiff -u $1 $2Compare two files line-by-line
bashdiff $1 $2
- file1 rule
Identify a file type by magic bytes (no native Windows equivalent)
bashfile $1
- find9 rules
Find files by name pattern (recursive)
bashfind $1 -name "$2"Find only regular files (recursive)
bashfind $1 -type fFind only directories (recursive)
bashfind $1 -type dFind files by name and delete them
bashfind $1 -name "$2" -exec rm {} \;Find files matching a name and search inside them
bashfind $1 -name "$2" -exec grep "$3" {} \;Find files modified within the last N days
bashfind $1 -mtime -$2Find files larger than N megabytes
bashfind $1 -size +$2MFind empty files and directories
bashfind $1 -emptySkip a subtree while searching (no clean PowerShell equivalent)
bashfind $1 -name "$2" -prune -o -print
- grep14 rules
Recursive case-insensitive search
bashgrep -ri "$1" $2Recursive search
bashgrep -r "$1" $2Case-insensitive search in a file
bashgrep -i "$1" $2Invert match — lines NOT matching pattern
bashgrep -v "$1" $2Show line numbers
bashgrep -n "$1" $2Search a file for a pattern
bashgrep "$1" $2Extended regex search
bashgrep -E "$1" $2Fixed-string (literal) search
bashgrep -F "$1" $2List filenames containing matches, not the matches themselves
bashgrep -l "$1" $2Count matching lines
bashgrep -c "$1" $2Show N lines of trailing context after each match
bashgrep -A $1 "$2" $3Show N lines of leading context before each match
bashgrep -B $1 "$2" $3Show N lines of context around each match
bashgrep -C $1 "$2" $3Match only whole words
bashgrep -w "$1" $2
- gzip1 rule
Decompress a .gz file in place
bashgunzip $1
- head3 rules
Print the first N lines of a file
bashhead -n $1 $2Print the first N lines of a file
bashhead -n $1 $2Print the first 10 lines of a file (default head)
bashhead $1
- jobs1 rule
List background jobs in the current shell session
bashjobs
- kill4 rules
Forcefully kill a process by PID
bashkill -9 $1Kill a process by PID
bashkill $1Kill all processes by name
bashkillall $1Kill processes whose name matches a pattern
bashpkill $1
- ls8 rules
List all files including hidden
bashls -laList all files including hidden in a directory
bashls -la $1List files with human-readable sizes
bashls -lhList files sorted by modification time, newest first
bashls -ltList only directories
bashls -d */Long listing (permissions, owner, size)
bashls -lList a directory
bashls $1List directory contents
bashls
- mkdir2 rules
Create a directory tree, ignore if exists
bashmkdir -p $1Create a directory
bashmkdir $1
- mv1 rule
Rename or move a file
bashmv $1 $2
- patch1 rule
Apply a unified diff patch
bashpatch -p1 < $1
- ping1 rule
Send ICMP echo requests to a host
bashping $1
- ps3 rules
List all running processes
bashps auxList all running processes (System V format)
bashps -efShow one process by its PID
bashps -p $1
- pwd1 rule
Print working directory
bashpwd
- rm4 rules
Recursively delete a directory and contents, no prompts
bashrm -rf $1Recursively delete a directory
bashrm -r $1Delete a file without prompting
bashrm -f $1Delete a file
bashrm $1
- rsync2 rules
Recursively sync with compression and metadata preservation
bashrsync -avz $1 $2Recursively sync, preserving permissions and timestamps
bashrsync -av $1 $2
- scp2 rules
Recursively copy a directory over SSH
bashscp -r $1 $2Copy a file over SSH
bashscp $1 $2
- sed2 rules
In-place find-and-replace in a file
bashsed -i "s/$1/$2/g" $3Stream editor (sed has no single PowerShell equivalent)
bashsed
- sort7 rules
Sort a file and remove duplicates
bashsort $1 | uniqSort and deduplicate lines in a file
bashsort -u $1Sort in reverse order
bashsort -r $1Sort lines in a file
bashsort $1Numeric sort (treat lines as numbers, not strings)
bashsort -n $1Sort by a specific whitespace-separated column
bashsort -k $1 $2Sort with a custom column delimiter
bashsort -t'$1' -k $2 $3
- ssh3 rules
Connect over SSH on a non-default port
bashssh -p $1 $2Run a remote command via SSH
bashssh $1 "$2"Open an interactive SSH session
bashssh $1
- stat2 rules
Print the size of a file in bytes
bashstat -c %s $1Show file metadata (mode, size, owner, timestamps)
bashstat $1
- tail4 rules
Follow a growing file
bashtail -f $1Print the last N lines of a file
bashtail -n $1 $2Print the last N lines of a file
bashtail -n $1 $2Print the last 10 lines of a file (default tail)
bashtail $1
- tar2 rules
Extract a gzipped tar archive
bashtar -xzf $1Create a gzipped tar archive
bashtar -czf $1 $2
- tee2 rules
Send pipeline output to a file and stdout
bash$1 | tee $2Send pipeline output, appending to a file
bash$1 | tee -a $2
- top1 rule
Interactive process viewer
bashtop
- tr1 rule
Delete a set of characters from input
bash$1 | tr -d "$2"
- uniq1 rule
Count occurrences of each unique line
bashsort $1 | uniq -c
- wc4 rules
Count lines in a file
bashwc -l $1Count words in a file
bashwc -w $1Count bytes in a file
bashwc -c $1Count characters in a file
bashwc -m $1
- wget1 rule
Download a file from a URL
bashwget $1
- xargs3 rules
Build and run a command from piped arguments
bash$1 | xargs $2Substitute the piped value into a command via {} placeholder
bash$1 | xargs -I {} $2Pass at most N arguments per invocation
bash$1 | xargs -n $2 $3
- zip2 rules
Extract a zip archive
bashunzip $1Recursively zip a directory
bashzip -r $1 $2
More from shellmap
- Compare two shells
Side-by-side syntax + command equivalents.
- Look up by task
Find files modified today, count lines, etc.
Total rules in this translator: 204.