Skip to content

Instantly share code, notes, and snippets.

@rbecheras
Forked from jonschlinkert/terminal-cheatsheet.md
Created November 25, 2017 22:03
Show Gist options
  • Save rbecheras/69f7ea2734b49f5909921e8c4ec6809a to your computer and use it in GitHub Desktop.
Save rbecheras/69f7ea2734b49f5909921e8c4ec6809a to your computer and use it in GitHub Desktop.

Cheatsheet

Move cursor

command description
ctrl+a Move cursor to the start of the line
ctrl+e Move cursor to the end of the line
ctrl+b Move cursor back one character
ctrl+f Move cursor forward one character

Windows

command description
alt+b Move cursor back one word
alt+f Move cursor forward one word

Cut/paste

command description
ctrl+_ Undo
ctrl+c Cancel the current command
ctrl+k Cut everything after the cursor position
ctrl+w Cut a word to the left of the cursor position
ctrl+y Paste the last deleted command
ctrl+d Clear one character to the right of the cursor position
ctrl+l Clear the entire terminal
ctrl+u Clear the current line
ctrl+xx Toggle between first and cursor position

Windows

command description
alt+< Cut a word to the left of the cursor
alt+d Cut a word to the right of the cursor

Search/history

command description
ctrl+r Search for a command in history (type a search term)
ctrl+g Cancel the search and restore original line
ctrl+j End the search at current history entry
ctrl+n Get next command from history
ctrl+ Get next command from history
ctrl+p Get previous command from history
ctrl+ Get previous command from history
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment