Skip to content

Instantly share code, notes, and snippets.

@njm2112
Forked from jonschlinkert/terminal-cheatsheet.md
Created August 13, 2016 04:20
Show Gist options
  • Save njm2112/afe766f9e172f896a011ce677e54b4f3 to your computer and use it in GitHub Desktop.
Save njm2112/afe766f9e172f896a011ce677e54b4f3 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