Bash has a very useful command-line editing feature that can increase your productivity while working on the Terminal. It enables the user to use some shortcut commands to move around or delete characters on the command prompt.
The following table lists the most useful command line shortcuts available in Bash:
Shortcut |
Description |
To move the cursor |
|
Ctrl + A |
Moves the cursor to the beginning of the command line |
Ctrl + E |
Moves the cursor to the end of the command line |
Ctrl + Left arrow |
Moves the cursor to the beginning of the previous word on the command line |
Ctrl + Right arrow |
Moves the cursor to the beginning of the next word on the command line |
To delete characters |
|
Ctrl + U |
Deletes the characters from the current cursor position to the beginning of the command line |
Ctrl + K |
Deletes the characters from the current cursor position to the end of the command line |
Ctrl + W |
Deletes the last word from the current cursor positing on the command line |
Ctrl + L |
Clears the screen (you can also type the clear command) |
To modify the size of the Terminal window |
|
Ctrl + + |
Increases the size of the Terminal window |
Ctrl - - |
Decreases the size of the Terminal window |