PowerShell keyboard shortcuts

PowerShell's interactive keyboard layer comes from PSReadLine. This reference covers its Windows, Emacs, and Vi modes across cursor movement, line editing, history, completion, selection, and multiline input.

Windows, macOS, Linux · 62 shortcuts

Cursor movement

Move by character, word, line, page, brace, or numeric argument while editing the current PowerShell command.

ActionWindowsmacOSLinux
Move left one characterCtrl+B is the Emacs binding; Left works in Windows and Vi insert modes.LeftorCtrlBLeftorCtrlBLeftorCtrlB
Move right one characterCtrl+F is the Emacs binding; Right works in Windows and Vi insert modes.RightorCtrlFRightorCtrlFRightorCtrlF
Move back one wordAlt+B is the Emacs binding. Vi insert and command modes also use Ctrl+Left.CtrlLeftorAltBCtrlLeftorAltBCtrlLeftorAltB
Move forward one wordAlt+F is the Emacs binding.CtrlRightorAltFCtrlRightorAltFCtrlRightorAltF
Move to the start of the lineHomeorCtrlAHomeorCtrlAHomeorCtrlA
Move to the end of the lineEndorCtrlEEndorCtrlEEndorCtrlE
Move to the start of the inputCtrlHomeCtrlHomeCtrlHome
Move to the end of the inputCtrlEndCtrlEndCtrlEnd
Go to the matching brace, parenthesis, or bracketCtrl]Ctrl]Ctrl]
Move to the first non-blank characterVi command mode; underscore is an alternative.^^^
Start a numeric argument for the next actionAlt+0 through Alt+9 and Alt+- set the argument in Windows and Emacs modes.Alt0Alt0Alt0

Editing the command line

Delete, insert, transform, transpose, accept, or cancel text before PowerShell evaluates the command.

ActionWindowsmacOSLinux
Delete the character before the cursorCtrl+H is the Emacs binding.BackspaceorCtrlHBackspaceorCtrlHBackspaceorCtrlH
Delete the character under the cursorDeleteDeleteDelete
Delete a character, or exit on an empty lineEmacs mode.CtrlDCtrlDCtrlD
Delete the previous word into the kill ringCtrl+Backspace and Ctrl+W are Windows mode; Alt+Backspace and Escape+Backspace are Emacs mode.CtrlBackspaceorCtrlWorAltBackspaceCtrlBackspaceorCtrlWorAltBackspaceCtrlBackspaceorCtrlWorAltBackspace
Delete the next word into the kill ringAlt+D is Windows and Emacs mode; Ctrl+Delete is also bound in Windows and Vi modes.AltDorCtrlDeleteAltDorCtrlDeleteAltDorCtrlDelete
Delete from the start of input to the cursorEmacs mode; Ctrl+X then Backspace is an alternative.CtrlUCtrlUCtrlU
Delete from the cursor to the end of inputEmacs mode.CtrlKCtrlKCtrlK
Delete from the cursor to the end of input without the kill ringWindows and Vi insert modes.CtrlEndCtrlEndCtrlEnd
Copy the selected region, or the whole lineWindows mode. In Emacs mode Ctrl+C copies when text is selected or cancels the line otherwise.CtrlCCtrlCCtrlC
Cut the selected regionWindows mode.CtrlXCtrlXCtrlX
Paste from the system clipboardWindows mode; Vi insert mode uses Ctrl+V.CtrlVorShiftInsertCtrlVorShiftInsertCtrlVorShiftInsert
Undo the previous editCtrl+Z is Windows and Vi mode; the alternatives are Emacs mode.CtrlZorCtrl_orCtrlXCtrlUCtrlZorCtrl_orCtrlXCtrlUCtrlZorCtrl_orCtrlXCtrlU
Redo an undone editWindows and Vi modes.CtrlYCtrlYCtrlY
Swap the current character with the previous oneEmacs and Vi insert modes.CtrlTCtrlTCtrlT
Capitalize the next wordEmacs mode. Escape+C is an alternative.AltCAltCAltC
Convert the next word to uppercaseEmacs mode. Escape+U is an alternative.AltUAltUAltU
Convert the next word to lowercaseEmacs mode. Escape+L is an alternative.AltLAltLAltL
Accept and run the current lineEnterorCtrlMEnterorCtrlMEnterorCtrlM
Insert a blank line aboveWindows mode.CtrlEnterCtrlEnterCtrlEnter
Insert a blank line belowWindows mode.CtrlShiftEnterCtrlShiftEnterCtrlShiftEnter
Insert a new line in multiline inputShiftEnterShiftEnterShiftEnter

History

Recall, search, clear, and move through PowerShell history without retyping commands you already composed.

ActionWindowsmacOSLinux
Load the previous history entryCtrl+P is the Emacs alternative. Vi command mode also supports K and minus.UporCtrlPUporCtrlPUporCtrlP
Load the next history entryCtrl+N is the Emacs alternative. Vi command mode also supports J and plus.DownorCtrlNDownorCtrlNDownorCtrlN
Find the previous history entry matching the current prefixWindows mode.F8F8F8
Find the next history entry matching the current prefixWindows mode.ShiftF8ShiftF8ShiftF8
Move to the first history itemEmacs mode.Alt<Alt<Alt<
Move to the current input at the end of historyEmacs mode.Alt>Alt>Alt>
Clear PSReadLine historyWindows mode. This does not clear PowerShell's persisted history.AltF7AltF7AltF7

Completion and display

Complete commands, show a menu of possible completions, inspect parameter help, clear the screen, and capture text.

ActionWindowsmacOSLinux
Complete the text around the cursorEmacs mode. Windows mode uses Tab for TabCompleteNext.TabTabTab
Display possible completionsAlt+= is Emacs mode; Ctrl+Space is Vi insert and command mode.Alt=orCtrlSpaceAlt=orCtrlSpaceAlt=orCtrlSpace
Select the next completionWindows mode and Vi command mode.TabTabTab
Select the previous completionWindows mode and Vi insert or command mode.ShiftTabShiftTabShiftTab
Show dynamic parameter helpAltHAltHAltH
Clear the screen and redraw the current lineCtrlLCtrlLCtrlL
Start interactive screen captureThe function is unbound by default. Bind it with Set-PSReadLineKeyHandler if you need it.Not documentedNot documentedNot documented

Selection and Vi mode

Select text, move through visual ranges, and use the mode-specific bindings that only appear in PSReadLine's Vi command layer.

ActionWindowsmacOSLinux
Select one character leftShiftLeftShiftLeftShiftLeft
Select one character rightShiftRightShiftRightShiftRight
Select to the end of the lineShiftEndShiftEndShiftEnd
Select the next wordWindows mode.ShiftCtrlRightShiftCtrlRightShiftCtrlRight
Extend selection by the next wordEmacs mode.AltFAltFAltF
Set a mark at the cursorEmacs mode.Ctrl@Ctrl@Ctrl@
Switch from Vi insert to Vi command modeVi mode.EscEscEsc
Delete the current lineVi command mode.dddddd
Undo all edits for the lineVi command mode.UUU
Open the current command in the external editorVi command mode; Emacs uses Ctrl+X then Ctrl+E.vvv
Start a Vi history searchVi command mode. The search starts after you accept the search text.///
Paste before the cursorVi command mode.PPP
Paste after the cursorVi command mode.ppp

Make a printable PowerShell sheet