Skip to content

Instantly share code, notes, and snippets.

@roddds
Last active August 12, 2023 01:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roddds/d6dccd78768bf0017d5bd865c912b3b2 to your computer and use it in GitHub Desktop.
Save roddds/d6dccd78768bf0017d5bd865c912b3b2 to your computer and use it in GitHub Desktop.

Cursor Movement

Key Combination Description
Ctrl + A Move to the beginning of the line
Ctrl + E Move to the end of the line
Ctrl + B Move one character backward
Ctrl + F Move one character forward
Alt + B Move one word backward
Alt + F Move one word forward
Alt + [Right Arrow] Move one word forward
Alt + [Left Arrow] Move one word backward

Text Manipulation

Key Combination Description
Ctrl + K Kill (cut) to the end of the line
Ctrl + U Kill (cut) the entire line
Ctrl + W Kill (cut) word backward
Alt + D Kill word forward
Ctrl + T Transpose (swap) characters
Alt + T Transpose (swap) words
Ctrl + Y Yank (paste) from buffer
Alt + y Rotate yanked text

History Navigation

Key Combination Description
Ctrl + N Move to the next line or history item
Ctrl + P Move to the previous line or history item
Alt + . Insert last word from previous command
Ctrl + R Search history backward
Ctrl + S Search history forward
Alt + < Move to the beginning of history or buffer
Alt + > Move to the end of history or buffer

Autocompletion and Help

Key Combination Description
Ctrl + I Expand or complete command
Alt + ? Show command for current keybinding
Ctrl + X, h Display help for completion

Miscellaneous

Key Combination Description
Ctrl + G Send a break/interrupt signal
Ctrl + L Clear the screen
Ctrl + M Accept the current line
Ctrl + J Accept the current line
Ctrl + O Accept current line and move to the next history item
Ctrl + Q Push current line to buffer
Ctrl + V Insert next character verbatim
Ctrl + X, * Expand word to possible completions
Ctrl + X, = Display cursor position
Ctrl + X, ? Debug completion
Ctrl + X, C Correct filename
Ctrl + X, G List-expand
Ctrl + X, a Expand alias
Ctrl + X, c Correct word
Ctrl + X, d List possible expansions
Ctrl + X, e Expand word
Ctrl + X, g List-expand
Ctrl + X, m Most recent file
Ctrl + X, n Next tags
Ctrl + X, r Search history backward
Ctrl + X, s Search history forward
Ctrl + X, t Complete tag
Ctrl + X, u Undo last change
Ctrl + X, ~ Bash list choices
Ctrl + H Delete one character backward
Ctrl + D Delete character or list if line is empty
Ctrl + ? Delete one character backward
Space Insert space and check for magic behavior
!-~ Insert character
Key Combination Description
Ctrl + @ Sets a mark for region selection, useful for text operations like cut or copy.
Ctrl + A Moves the cursor to the beginning of the line.
Ctrl + B Moves the cursor one character to the left.
Ctrl + D Deletes the character under the cursor. If the line is empty, it may list possible completions or exit the shell.
Ctrl + E Moves the cursor to the end of the line.
Ctrl + F Moves the cursor one character to the right.
Ctrl + G Sends a break or interrupt signal, often used to exit from a current operation or command.
Ctrl + H Deletes the character to the left of the cursor.
Ctrl + I Attempts to auto-complete the command or filename being typed.
Ctrl + J Accepts the current line or command (equivalent to pressing Enter).
Ctrl + K Deletes (or "kills") the text from the cursor to the end of the line.
Ctrl + L Clears the screen and redisplay the line.
Ctrl + M Accepts the current line or command (equivalent to pressing Enter).
Ctrl + N Navigates to the next command in the command history.
Ctrl + O Accepts the current line and then displays the next line in history.
Ctrl + P Navigates to the previous command in the command history.
Ctrl + Q Pushes the current line into a buffer for later use.
Ctrl + R Initiates a backward search through the command history.
Ctrl + S Initiates a forward search through the command history.
Ctrl + T Swaps the character under the cursor with the previous one.
Ctrl + U Deletes the text from the cursor to the beginning of the line.
Ctrl + V Allows the next character pressed to be inserted verbatim, especially useful for inserting control characters.
Ctrl + W Deletes the word to the left of the cursor.
Ctrl + X, Ctrl + B Matches and jumps to the corresponding bracket in the command line (useful in vi mode).
Ctrl + X, Ctrl + E Opens the current command line in an editor for more complex editing tasks.
Ctrl + X, Ctrl + F Finds the next character in the line, used in vi command mode.
Ctrl + X, Ctrl + J Joins the current line with the next one, used in vi command mode.
Ctrl + X, Ctrl + K Kills the content of the buffer, effectively clearing it.
Ctrl + X, Ctrl + N Infers and suggests the next command in history based on the current context.
Ctrl + X, Ctrl + O Toggles overwrite mode, where typed characters replace existing ones.
Ctrl + X, Ctrl + R A specific command behavior, might be related to reading or refreshing something.
Ctrl + X, Ctrl + U Undoes the last change made to the line.
Ctrl + X, Ctrl + V Enters the command mode in vi editing mode.
Ctrl + X, Ctrl + X Exchanges the position of the cursor and the mark, useful for text selection.
Ctrl + X, * Expands the current word to show all possible completions.
Ctrl + X, = Displays the current cursor position in terms of row and column.
Ctrl + X, ? Provides debugging information for command completion.
Ctrl + X, C Attempts to correct the filename being typed.
Ctrl + X, G Expands the current word into a list of possible completions.
Ctrl + X, a Expands the current word if it's an alias.
Ctrl + X, c Attempts to correct the word being typed.
Ctrl + X, d Lists all possible expansions of the current word.
Ctrl + X, e Expands the current word, similar to auto-completion.
Ctrl + X, g Expands the current word into a list of possible completions.
Ctrl + X, h Provides help or information about the current completion.
Ctrl + X, m Suggests the most recent file, useful for quickly accessing recently used files.
Ctrl + X, n Suggests the next tags or completions based on context.
Ctrl + X, r Initiates a backward search through the command history.
Ctrl + X, s Initiates a forward search through the command history.
Ctrl + X, t Completes the current word based on available tags.
Ctrl + X, u Undoes the last change made to the line.
Ctrl + X, ~ Provides a list of choices based on bash completion.
Ctrl + Y Pastes (or "yanks") the text from the buffer.
Alt + Ctrl + D Lists all possible completions for the current word or command.
Alt + Ctrl + G Sends a break or interrupt signal, similar to Ctrl + G.
Alt + Ctrl + H Deletes the word to the left of the cursor.
Alt + Ctrl + I Inserts the character without any meta or control modification.
Alt + Ctrl + J Inserts the character without any meta or control modification.
Alt + Ctrl + L Clears the screen, similar to Ctrl + L.
Alt + Ctrl + M Inserts the character without any meta or control modification.
Alt + Ctrl + _ Copies the previous word to the buffer.
Alt + Space Expands the current command based on history.
Alt + ! Expands the current command based on history.
Alt + " Quotes or escapes the selected region, preventing it from being interpreted by the shell.
Alt + $ Checks the spelling of the current word.
Alt + ' Quotes the entire line, preventing it from being interpreted by the shell.
Alt + , Completes the command based on newer entries in history.
Alt + - Used to specify a negative argument for commands that accept numeric arguments.
Alt + . Inserts the last word from the previous command, useful for repeating arguments.
Alt + / Completes the command based on older entries in history.
Alt + 0-9 Used to specify a numeric argument for commands.
Alt + < Moves the cursor to the beginning of the command history.
Alt + > Moves the cursor to the end of the command history.
Alt + ? Displays the command associated with the current keybinding.
Alt + A Accepts the current line and holds it for later, without executing.
Alt + B Moves the cursor one word to the left.
Alt + C Capitalizes the word under the cursor.
Alt + D Deletes the word to the right of the cursor.
Alt + F Moves the cursor one word to the right.
Alt + G Fetches a specific line or command.
Alt + H Displays help or manual page for the current command.
Alt + L Converts the word under the cursor to lowercase.
Alt + N Searches forward in the command history for commands that match the current line.
Alt + OA Moves the cursor up or searches from the beginning of the line.
Alt + OB Moves the cursor down or searches from the beginning of the line.
Alt + OC Moves the cursor one character to the right.
Alt + OD Moves the cursor one character to the left.
Alt + OF Moves the cursor to the end of the line.
Alt + OH Moves the cursor to the beginning of the line.
Alt + P Searches backward in the command history for commands that match the current line.
Alt + Q Pushes the current line into a buffer, similar to Ctrl + Q.
Alt + S Checks the spelling of the current word.
Alt + T Swaps the positions of the current word and the previous word.
Alt + U Converts the word under the cursor to uppercase.
Alt + W Copies the selected region to the buffer.
Alt + [1;5C] Moves the cursor one word to the right.
Alt + [1;5D] Moves the cursor one word to the left.
Alt + [200~] Indicates the start of a bracketed paste, where text is pasted verbatim.
Alt + [2~] Toggles overwrite mode.
Alt + [3;5~] Deletes the word to the right of the cursor.
Alt + [3~] Deletes the character under the cursor.
Alt + [5~] Moves the cursor to the previous line or command in history.
Alt + [6~] Moves the cursor to the next line or command in history.
Alt + [A] Moves the cursor to the previous line or command in history.
Alt + [B] Moves the cursor to the next line or command in history.
Alt + [C] Moves the cursor one character to the right.
Alt + [D] Moves the cursor one character to the left.
Alt + [Z] Reverses the order of menu completion options.
Alt + _ Inserts the last word from the previous command.
Alt + a Accepts the current line and holds it for later, without executing.
Alt + b Moves the cursor one word to the left.
Alt + c Capitalizes the word under the cursor.
Alt + d Deletes the word to the right of the cursor.
Alt + f Moves the cursor one word to the right.
Alt + g Fetches a specific line or command.
Alt + h Displays help or manual page for the current command.
Alt + l Executes the "ls" command, listing directory contents.
Alt + m Copies the previous word from the shell to the buffer.
Alt + n Searches forward in the command history for commands that match the current line.
Alt + p Searches backward in the command history for commands that match the current line.
Alt + q Pushes the current line into a buffer, similar to Ctrl + Q.
Alt + s Checks the spelling of the current word.
Alt + t Swaps the positions of the current word and the previous word.
Alt + u Converts the word under the cursor to uppercase.
Alt + w Deletes the selected region.
Alt + x Executes a specific named command.
Alt + y Rotates through yanked (pasted) text, allowing you to cycle through past clipboard entries.
Alt + z Executes the last specific named command.
Alt + | Moves the cursor to a specific column in vi command mode.
Alt + ~ Completes the current word based on bash's completion system.
Alt + Ctrl + ? Deletes the word to the left of the cursor.
Ctrl + _ Undoes the last change made to the line.
Space Inserts a space character. In some configurations, it might also attempt to auto-complete or perform other "magic" behaviors.
!-~ Represents a range of characters. Pressing any character in this range will insert that character into the command line.
Ctrl + ? Deletes the character to the left of the cursor.
Alt + Ctrl + @-Alt + Ctrl + ? Inserts the character without any meta or control modification.
Key Combination Description
Ctrl + @ Set mark for region selection
Ctrl + A Move to the beginning of the line
Ctrl + B Move one character backward
Ctrl + D Delete character or list if line is empty
Ctrl + E Move to the end of the line
Ctrl + F Move one character forward
Ctrl + G Send a break/interrupt signal
Ctrl + H Delete one character backward
Ctrl + I Expand or complete command
Ctrl + J Accept the current line
Ctrl + K Kill (cut) to the end of the line
Ctrl + L Clear the screen
Ctrl + M Accept the current line
Ctrl + N Move to the next line or history item
Ctrl + O Accept current line and move to the next history item
Ctrl + P Move to the previous line or history item
Ctrl + Q Push current line to buffer
Ctrl + R Search history backward
Ctrl + S Search history forward
Ctrl + T Transpose (swap) characters
Ctrl + U Kill (cut) the entire line
Ctrl + V Insert next character verbatim
Ctrl + W Kill (cut) word backward
Ctrl + X, Ctrl + B Match brackets in command
Ctrl + X, Ctrl + E Edit command line in an editor
Ctrl + X, Ctrl + F Find next character in line (vi mode)
Ctrl + X, Ctrl + J Join lines (vi mode)
Ctrl + X, Ctrl + K Kill buffer content
Ctrl + X, Ctrl + N Infer next history command
Ctrl + X, Ctrl + O Toggle overwrite mode
Ctrl + X, Ctrl + R Specific command behavior
Ctrl + X, Ctrl + U Undo last change
Ctrl + X, Ctrl + V Enter command mode (vi mode)
Ctrl + X, Ctrl + X Swap cursor position and mark
Ctrl + X, * Expand word to possible completions
Ctrl + X, = Display cursor position
Ctrl + X, ? Debug completion
Ctrl + X, C Correct filename
Ctrl + X, G Expand list
Ctrl + X, a Expand alias
Ctrl + X, c Correct word
Ctrl + X, d List possible expansions
Ctrl + X, e Expand word
Ctrl + X, g Expand list
Ctrl + X, h Display help for completion
Ctrl + X, m Most recent file
Ctrl + X, n Next tags
Ctrl + X, r Search history backward
Ctrl + X, s Search history forward
Ctrl + X, t Complete tag
Ctrl + X, u Undo last change
Ctrl + X, ~ Bash list choices
Ctrl + Y Yank (paste) from buffer
Alt + Ctrl + D List choices for completion
Alt + Ctrl + G Send a break/interrupt signal
Alt + Ctrl + H Kill word backward
Alt + Ctrl + I Insert unmodified version
Alt + Ctrl + J Insert unmodified version
Alt + Ctrl + L Clear the screen
Alt + Ctrl + M Insert unmodified version
Alt + Ctrl + _ Copy previous word
Alt + Space Expand history
Alt + ! Expand history
Alt + " Quote selected region
Alt + $ Spell-check word
Alt + ' Quote the entire line
Alt + , Complete history newer
Alt + - Negative argument prefix
Alt + . Insert last word from previous command
Alt + / Complete history older
Alt + 0-9 Specify argument value
Alt + < Move to the beginning of history or buffer
Alt + > Move to the end of history or buffer
Alt + ? Show command for current keybinding
Alt + A Accept and hold current line
Alt + B Move one word backward
Alt + C Capitalize word
Alt + D Kill word forward
Alt + F Move one word forward
Alt + G Fetch a line
Alt + H Display help for command
Alt + L Convert word to lowercase
Alt + N Search history forward
Alt + OA Move up or search from beginning
Alt + OB Move down or search from beginning
Alt + OC Move one character forward
Alt + OD Move one character backward
Alt + OF Move to the end of the line
Alt + OH Move to the beginning of the line
Alt + P Search history backward
Alt + Q Push current line to buffer
Alt + S Spell-check word
Alt + T Transpose (swap) words
Alt + U Convert word to uppercase
Alt + W Copy selected region
Alt + [1;5C] Move one word forward
Alt + [1;5D] Move one word backward
Alt + [200~] Begin bracketed paste mode
Alt + [2~] Toggle overwrite mode
Alt + [3;5~] Kill word forward
Alt + [3~] Delete character
Alt + [5~] Move to the previous line or history item
Alt + [6~] Move to the next line or history item
Alt + [A] Move to the previous line or history item
Alt + [B] Move to the next line or history item
Alt + [C] Move one character forward
Alt + [D] Move one character backward
Alt + [Z] Reverse menu completion
Alt + _ Insert last word
Alt + a Accept and hold current line
Alt + b Move one word backward
Alt + c Capitalize word
Alt + d Kill word forward
Alt + f Move one word forward
Alt + g Fetch a line
Alt + h Display help for command
Alt + l Execute "ls" command
Alt + m Copy previous shell word
Alt + n Search history forward
Alt + p Search history backward
Alt + q Push current line to buffer
Alt + s Spell-check word
Alt + t Transpose (swap) words
Alt + u Convert word to uppercase
Alt + w Kill selected region
Alt + x Execute a named command
Alt + y Rotate yanked text
Alt + z Execute the last named command
Alt + | Move to a specific column (vi mode)
Alt + ~ Bash complete word
Alt + Ctrl + ? Kill word backward
Ctrl + _ Undo last change
Space Insert space and check for magic behavior
!-~ Insert character
Ctrl + ? Delete one character backward
Alt + Ctrl + @-Alt + Ctrl + ? Insert unmodified version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment