While typing a command line, you can use some key shortcuts to edit the text of the command line and move the text cursor forward and backward.
To edit the text of a command line, use the following key shortcuts:
-
Backspace
: delete the previous character.
-
Ctrl+D
: delete the current character.
-
Alt+C
: change to uppercase the first character and to lowercase the remaining characters of the current word.
-
Alt+U
: convert the current word to uppercase.
-
Alt+L
: convert the current word to lowercase.
To cut and paste the text of a command line, use the following key shortcuts:
-
Ctrl+K
: cut the text on the right of the cursor (to the end of the line).
-
Ctrl+u
: cut the text on the left of the cursor (to the beginning of the line).
-
Ctrl+w
: cut the word on the left of the cursor.
-
Alt+d
: cut the word on the right of the cursor.
-
Ctrl+y
: paste the last cut text.
To move the text cursor forward and backward, use the following key shortcuts:
-
Right Arrow
, Ctrl+f
: move the text cursor forward one character.
-
Left Arrow
, Ctrl+b
: move the text cursor backward one character.
-
Alt+f
: move the text cursor forward one word.
-
Alt+b
: move the text cursor backward one word.
-
Ctrl+a
: move the text cursor to the beginning of the line.
-
Ctrl+e
: move the text cursor to the end of the line.
To find a previously executed command line, use the following key shortcuts:
-
Up/Down Arrow
: move forward and backward in the command line history.
-
Ctrl+r
: search a string in the command line history
(keep pressing the key shortcut to go through command lines that match the string).
-
Alt+p
: search a string in the command line history
(press Enter when you finish typing the string to see the last command line that match the string).