Last Updated: 29 Oct 2023

   |   

Author: 114.119.147.6

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
server-tech:gnu-readline-useful-command-line-shortcuts [Nov 10, 2008 10:18 PM]
dordal
server-tech:gnu-readline-useful-command-line-shortcuts [Oct 29, 2023 10:31 PM]
114.119.147.6 old revision restored (Oct 23, 2023 03:38 PM)
Line 1: Line 1:
 += GNU Readline: Useful Command Line Navigation Tools =
  
 +Most varieties of Unix/Linux use [[http://tiswww.case.edu/php/chet/readline/rltop.html|GNU Readline]] which lets you edit commands on the command line, gives you a command-line history, handles tab-completion, and the like. 
 +
 +Many of the basic commands are pretty obvious: you use the left/right arrow keys to move your cursor. Up/down arrow keys scroll through the saved command history.
 +
 +Some, however, **extremely** useful, but are a bit more esoteric. Remmeber that C means the 'Control' key, and M means the 'Meta' key, which is usually Option (OS X) or ALT (Windows).
 +
 +**C-a** - move to the beginning of the line.
 +**C-e** - move to the end of the line
 +**M-b** - move back one word (incidentally, C-f is forward a character, but you have arrow keys for that)
 +**M-f** - move forward one work
 +**C-]** + //character// - move forward to the next instance of //character//
 +**M-C-]** + //character// - same, but move backwards
 +
 +Finally, there are some //really// esoteric commands. Generally, I don't find it that worthwhile to learn these, but Peter Krumins has put together a [[http://www.catonmat.net/download/readline-emacs-editing-mode-cheat-sheet.pdf|GNU Readline cheat sheet]] with all the gory details. He's also got a good article that covers [[http://www.catonmat.net/blog/bash-emacs-editing-mode-cheat-sheet/|a few of the more advanced concepts]].