Bash vs PowerShell: line editing and history shortcuts compared

22 tasks · 18 with a documented equivalent in both · updated 2026-10-07

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 on Windows are Windows text-editing keys. The table lines up the same editing action in both so the mapping is visible at a glance.

TaskBash / ShellPowerShell
Start of lineCtrl + AHome
End of lineCtrl + EEnd
Back one wordAlt + BCtrl + Left
Forward one wordAlt + FCtrl + Right
Delete word before cursorAlt + BackspaceCtrl + Backspace
Delete word after cursorAlt + DCtrl + Delete
Delete to line startCtrl + UCtrl + Home
Delete to line endCtrl + KCtrl + End
UndoCtrl + _Ctrl + Z
Redo—Ctrl + Y
Clear screenCtrl + LCtrl + L
Reverse history searchCtrl + RCtrl + R
Forward history searchCtrl + SCtrl + S
Previous commandCtrl + PUp
Next commandCtrl + NDown
Last argument of previous commandAlt + .Alt + .
Repeat last command!!—
Tab completionTabTab
Menu completion—Ctrl + Space
Cancel / interruptCtrl + CCtrl + C
Paste (Bash: last killed text)Ctrl + YCtrl + 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 Bash syntax with no counterpart on the PowerShell page; the last argument of the previous command is on Alt + . in both shells. Our Bash table also covers typed syntax — history expansion, job control, pipes and redirection, builtins and special parameters — which is 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 the rest, including Bash's pipes and redirection and PowerShell's prediction and argument-selection keys.

Full references: Bash / Shell (171) · PowerShell (83) · all comparisons

Same tasks, different philosophies

The table pairs line-editing and history keys. The commands typed on that line differ more: a bash pipeline passes text from one program to the next, with tools such as grep, awk and cut to pick it apart, while PowerShell cmdlets pass objects with properties, so Where-Object and Sort-Object filter and sort without text parsing. PowerShell on Windows also defines aliases such as ls and cat for Get-ChildItem and Get-Content; they are conveniences rather than the Unix programs, and on Linux and macOS they are removed so that the native commands run.

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; the PowerShell page prints PSReadLine's Windows mode and Emacs mode side by side, and the Emacs column is the one that largely matches Bash.