Skip to content

Instantly share code, notes, and snippets.

@olegakbarov
Last active June 14, 2016 16:34
Show Gist options
  • Save olegakbarov/77f03d141fb8ba5054c4 to your computer and use it in GitHub Desktop.
Save olegakbarov/77f03d141fb8ba5054c4 to your computer and use it in GitHub Desktop.
bash superpowers

Basic moves

  • Move back one character. Ctrl + b
  • Move forward one character. Ctrl + f
  • Delete current character. Ctrl + d
  • Delete previous character. Backspace
  • Undo. Ctrl + -

Moving faster

  • Move to the start of line. Ctrl + a
  • Move to the end of line. Ctrl + e
  • Move forward a word. Meta + f (a word contains alphabets and digits, no symbols)
  • Move backward a word. Meta + b
  • Clear the screen. Ctrl + l

Cut and paste (‘Kill and yank’ for old schoolers)

  • Cut from cursor to the end of line. Ctrl + k
  • Cut from cursor to the end of word. Meta + d
  • Cut from cursor to the start of word. Meta + Backspace
  • Cut from cursor to previous whitespace. Ctrl + w
  • Paste the last cut text. Ctrl + y
  • Loop through and paste previously cut text. Meta + y (use it after Ctrl + y)
  • Loop through and paste the last argument of previous commands. Meta + .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment