Skip to content

Instantly share code, notes, and snippets.

@starikovs
Last active August 29, 2015 14:00
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 starikovs/11343892 to your computer and use it in GitHub Desktop.
Save starikovs/11343892 to your computer and use it in GitHub Desktop.
--- basic moves ---
ctrl+b (move back one character)
ctrl+f (move forward one character)
ctrl+d (delete current character)
backspace/mac delele (delete previous character)
ctrl+- (undo)
--- moving faster ---
ctrl+a (move to the start of line)
ctrl+e (move to the end of line)
meta+f (move forward a word)
meta+b (move back a word)
ctrl+l (clear screen)
For mac "meta" should be activated in keyboard settings of terminal. "meta" is alt/option key.
--- cut and paster (kill and yank for old schoolers) ---
ctrl+u (cut from cursor to the start of line)
ctrl+k (cut from cursor to the end of line)
meta+d (cut from cursor to the end of word)
meta+backspace (cut from cursor to the start of word)
ctrl+w (cut from cursor to the whitespace)
meta-y (use after ctrl+y, loop through cut history pasting previously cut text)
meta+. (loop through and paste the last argument of previous commands)
ctrl+c (abort what you're typing)
--- search the command history ---
ctrl+r (type the search term, ctrl+r to loop through results)
ctrl+rr (search the last rememebered search term)
ctrl+j (end the search at current history entry)
ctrl+g (cancel the search and restore original line)
--- sudo ---
apt-get update (error)
sudo !! (do previous command with sudo)
[user@comp /]$ /home/user/projects
bash: /home/user/projects: Is a directory
[user@comp /]$ cd !!
cd /home/user/projects
[user@comp projects]$
--- interesting commands http://habrahabr.ru/post/228999/ ---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment