Bash vs PowerShell: line editing and history shortcuts compared
Bash (through readline) and PowerShell (through PSReadLine) both give you an editable command line with history search, but they inherit different conventions: readline's defaults are Emacs-style control and meta keys, PSReadLine's defaults are Windows text-editing keys. The table lines up the same editing action in both so the mapping is visible at a glance.
| Task | Bash / Shell | PowerShell |
|---|---|---|
| Start of line | Ctrl + A | Home |
| End of line | Ctrl + E | End |
| Back one word | Alt + B | Ctrl + Left |
| Forward one word | Alt + F | Ctrl + Right |
| Delete word before cursor | Ctrl + W | Ctrl + Backspace |
| Delete word after cursor | Alt + D | Ctrl + Delete |
| Delete to line start | Ctrl + U | Ctrl + Home |
| Delete to line end | Ctrl + K | Ctrl + End |
| Undo | Ctrl + _ | Ctrl + Z |
| Redo | — | Ctrl + Y |
| Clear screen | Ctrl + L | Ctrl + L |
| Reverse history search | Ctrl + R | Ctrl + R |
| Forward history search | Ctrl + S | Ctrl + S |
| Previous command | Ctrl + P | Up |
| Next command | Ctrl + N | Down |
| Last argument of previous command | !$ | Alt + . |
| Repeat last command | !! | — |
| Tab completion | — | Tab |
| Menu completion | — | Ctrl + Space |
| Cancel / interrupt | — | Ctrl + C |
| Paste | Ctrl + Y | Ctrl + V |
| Select all | — | Ctrl + A |
The two biggest collisions are Ctrl + A and Ctrl + Y. In Bash, Ctrl + A jumps to the start of the line and Ctrl + Y pastes (yanks) the last killed text; in PowerShell, Ctrl + A selects all and Ctrl + Y is redo. Ctrl + R, Ctrl + S and Ctrl + L behave the same in both. History expansion (!! and !$) is a Bash-only syntax; PowerShell gets the last argument with Alt + . instead and has no one-keystroke 'repeat last command'. Our Bash table also covers file, text and process commands (ls, grep, ps, kill), which have PowerShell cmdlet equivalents but are outside this keystroke comparison.
PSReadLine can be switched to Emacs bindings with Set-PSReadLineOption -EditMode Emacs, after which most of the Bash column applies in PowerShell too. That is the easiest route for anyone who lives in both shells; the per-tool pages list everything else, including Bash's pipes and redirection and PowerShell's prediction and argument-selection keys.
Full references: Bash / Shell (52) · PowerShell (33) · all comparisons
Same tasks, different philosophies
The table pairs everyday shell tasks — listing, filtering, finding, environment variables, redirection — in bash and PowerShell. The rows look alike, but the columns work on different things: bash commands pass text through pipes and rely on grep, awk and cut to pick it apart, while PowerShell cmdlets pass objects with properties, so Where-Object and Select-Object replace text parsing. That is why several PowerShell entries are longer and why aliases such as ls and cat exist in PowerShell as conveniences that do not behave exactly like their bash namesakes.
Cross-platform notes
PowerShell 7 runs on Linux and macOS and bash runs on Windows through WSL and Git Bash, so the choice is increasingly about the task rather than the operating system. On Windows, PowerShell's access to .NET and system administration cmdlets is the reason to learn it; on servers, bash remains the scripting lingua franca. Each shell's full reference on this site lists the line-editing keys, which are nearly identical in both.