Friday, January 13, 2012

Terminal command line editing shortcuts

From CentOs Bible PDF E-Book.

TABLE 4-1
Keystrokes for Navigating Command Lines
Keystroke Full Name Meaning
[Ctrl]+f Character forward Go forward one character.
[Ctrl]+b Character backward Go backward one character.
[Alt]+f Word forward Go forward one word.
[Alt]+b Word backward Go backward one word.
[Ctrl]+a ([Home] key) Beginning of line Go to the beginning of the current line.
[Ctrl]+e ([End] key) End of line Go to the end of the line.
[Ctrl]+l Clear screen Clear screen and leave line at the top of
                     the screen.


TABLE 4-2
Keystrokes for Editing Command Lines
Keystroke Full Name Meaning
[Ctrl]+d Delete current Delete the current character.
[Backspace] Delete previous Delete the previous character.
[Ctrl]+t Transpose character Switch positions of current and previous characters.
[Alt]+t Transpose words Switch positions of current and previous words.
[Alt]+u Uppercase word Change the current word to uppercase.
[Alt]+l Lowercase word Change the current word to lowercase.
[Alt]+c Capitalize word Change the current word to an initial capital.
[Ctrl]+v Insert special character Add a special character. For example, to add a [Tab]
                                 character, press [Ctrl]+v+[Tab].

TABLE 4-3
Keystrokes for Cutting and Pasting Text in Command Lines
Keystroke Description
[Ctrl]+k Cut text to the end of the line.
[Ctrl]+u Cut text to the beginning of the line.
[Ctrl]+w Cut the word located behind the cursor.
[Alt]+d Cut the word following the cursor.
[Ctrl]+y Paste most recently cut text.
[Alt]+y Rotate back to previously cut text and paste it.
[Ctrl]+c Cancel the entire command line.

No comments:

Post a Comment