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 shortcutsCursor movement
Move by character, word, line, page, brace, or numeric argument while editing the current PowerShell command.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Move left one characterCtrl+B is the Emacs binding; Left works in Windows and Vi insert modes. | LeftorCtrlB | LeftorCtrlB | LeftorCtrlB |
| Move right one characterCtrl+F is the Emacs binding; Right works in Windows and Vi insert modes. | RightorCtrlF | RightorCtrlF | RightorCtrlF |
| Move back one wordAlt+B is the Emacs binding. Vi insert and command modes also use Ctrl+Left. | CtrlLeftorAltB | CtrlLeftorAltB | CtrlLeftorAltB |
| Move forward one wordAlt+F is the Emacs binding. | CtrlRightorAltF | CtrlRightorAltF | CtrlRightorAltF |
| Move to the start of the line | HomeorCtrlA | HomeorCtrlA | HomeorCtrlA |
| Move to the end of the line | EndorCtrlE | EndorCtrlE | EndorCtrlE |
| Move to the start of the input | CtrlHome | CtrlHome | CtrlHome |
| Move to the end of the input | CtrlEnd | CtrlEnd | CtrlEnd |
| Go to the matching brace, parenthesis, or bracket | Ctrl] | 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. | Alt0 | Alt0 | Alt0 |
Editing the command line
Delete, insert, transform, transpose, accept, or cancel text before PowerShell evaluates the command.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Delete the character before the cursorCtrl+H is the Emacs binding. | BackspaceorCtrlH | BackspaceorCtrlH | BackspaceorCtrlH |
| Delete the character under the cursor | Delete | Delete | Delete |
| Delete a character, or exit on an empty lineEmacs mode. | CtrlD | CtrlD | CtrlD |
| Delete the previous word into the kill ringCtrl+Backspace and Ctrl+W are Windows mode; Alt+Backspace and Escape+Backspace are Emacs mode. | CtrlBackspaceorCtrlWorAltBackspace | CtrlBackspaceorCtrlWorAltBackspace | CtrlBackspaceorCtrlWorAltBackspace |
| Delete the next word into the kill ringAlt+D is Windows and Emacs mode; Ctrl+Delete is also bound in Windows and Vi modes. | AltDorCtrlDelete | AltDorCtrlDelete | AltDorCtrlDelete |
| Delete from the start of input to the cursorEmacs mode; Ctrl+X then Backspace is an alternative. | CtrlU | CtrlU | CtrlU |
| Delete from the cursor to the end of inputEmacs mode. | CtrlK | CtrlK | CtrlK |
| Delete from the cursor to the end of input without the kill ringWindows and Vi insert modes. | CtrlEnd | CtrlEnd | CtrlEnd |
| Copy the selected region, or the whole lineWindows mode. In Emacs mode Ctrl+C copies when text is selected or cancels the line otherwise. | CtrlC | CtrlC | CtrlC |
| Cut the selected regionWindows mode. | CtrlX | CtrlX | CtrlX |
| Paste from the system clipboardWindows mode; Vi insert mode uses Ctrl+V. | CtrlVorShiftInsert | CtrlVorShiftInsert | CtrlVorShiftInsert |
| Undo the previous editCtrl+Z is Windows and Vi mode; the alternatives are Emacs mode. | CtrlZorCtrl_orCtrlXCtrlU | CtrlZorCtrl_orCtrlXCtrlU | CtrlZorCtrl_orCtrlXCtrlU |
| Redo an undone editWindows and Vi modes. | CtrlY | CtrlY | CtrlY |
| Swap the current character with the previous oneEmacs and Vi insert modes. | CtrlT | CtrlT | CtrlT |
| Capitalize the next wordEmacs mode. Escape+C is an alternative. | AltC | AltC | AltC |
| Convert the next word to uppercaseEmacs mode. Escape+U is an alternative. | AltU | AltU | AltU |
| Convert the next word to lowercaseEmacs mode. Escape+L is an alternative. | AltL | AltL | AltL |
| Accept and run the current line | EnterorCtrlM | EnterorCtrlM | EnterorCtrlM |
| Insert a blank line aboveWindows mode. | CtrlEnter | CtrlEnter | CtrlEnter |
| Insert a blank line belowWindows mode. | CtrlShiftEnter | CtrlShiftEnter | CtrlShiftEnter |
| Insert a new line in multiline input | ShiftEnter | ShiftEnter | ShiftEnter |
History
Recall, search, clear, and move through PowerShell history without retyping commands you already composed.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Load the previous history entryCtrl+P is the Emacs alternative. Vi command mode also supports K and minus. | UporCtrlP | UporCtrlP | UporCtrlP |
| Load the next history entryCtrl+N is the Emacs alternative. Vi command mode also supports J and plus. | DownorCtrlN | DownorCtrlN | DownorCtrlN |
| Search history backward incrementally | CtrlR | CtrlR | CtrlR |
| Search history forward incrementally | CtrlS | CtrlS | CtrlS |
| Find the previous history entry matching the current prefixWindows mode. | F8 | F8 | F8 |
| Find the next history entry matching the current prefixWindows mode. | ShiftF8 | ShiftF8 | ShiftF8 |
| 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. | AltF7 | AltF7 | AltF7 |
Completion and display
Complete commands, show a menu of possible completions, inspect parameter help, clear the screen, and capture text.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Complete the text around the cursorEmacs mode. Windows mode uses Tab for TabCompleteNext. | Tab | Tab | Tab |
| Show completion options in a menuEmacs mode uses Ctrl+Space. Windows mode uses Ctrl+Spacebar or Ctrl+@. | CtrlSpaceorCtrl@ | CtrlSpaceorCtrl@ | CtrlSpaceorCtrl@ |
| Display possible completionsAlt+= is Emacs mode; Ctrl+Space is Vi insert and command mode. | Alt=orCtrlSpace | Alt=orCtrlSpace | Alt=orCtrlSpace |
| Select the next completionWindows mode and Vi command mode. | Tab | Tab | Tab |
| Select the previous completionWindows mode and Vi insert or command mode. | ShiftTab | ShiftTab | ShiftTab |
| Show dynamic parameter help | AltH | AltH | AltH |
| Clear the screen and redraw the current line | CtrlL | CtrlL | CtrlL |
| Start interactive screen captureThe function is unbound by default. Bind it with Set-PSReadLineKeyHandler if you need it. | Not documented | Not documented | Not 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.
| Action | Windows | macOS | Linux |
|---|---|---|---|
| Select one character left | ShiftLeft | ShiftLeft | ShiftLeft |
| Select one character right | ShiftRight | ShiftRight | ShiftRight |
| Select to the end of the line | ShiftEnd | ShiftEnd | ShiftEnd |
| Select the next wordWindows mode. | ShiftCtrlRight | ShiftCtrlRight | ShiftCtrlRight |
| Extend selection by the next wordEmacs mode. | AltF | AltF | AltF |
| Set a mark at the cursorEmacs mode. | Ctrl@ | Ctrl@ | Ctrl@ |
| Switch from Vi insert to Vi command modeVi mode. | Esc | Esc | Esc |
| Delete the current lineVi command mode. | dd | dd | dd |
| Undo all edits for the lineVi command mode. | U | U | U |
| Open the current command in the external editorVi command mode; Emacs uses Ctrl+X then Ctrl+E. | v | v | v |
| Start a Vi history searchVi command mode. The search starts after you accept the search text. | / | / | / |
| Paste before the cursorVi command mode. | P | P | P |
| Paste after the cursorVi command mode. | p | p | p |