You can use the arrow keys on keyboard to move around in the command line. Bash also provides convenient keyboard
shortcuts to navigate effectively. Try them out and see for yourself.
To become a Bash pro user you have to get yourself familiar with the keyboard shortcuts. Once you do, you’ll find
|move backward one character
|move forward one character
|move one word backward
|move one word forward
|move to beginning of line
|move to end of line
|move to previous line
|move to next line
|move to first line of history list
|move to last line of history list
Moving around words using
ESC+b are my favourites in this list. Jumping to first and last lines of the
history list is also useful.
Deleting And Undeleting
Bash provides convenient keyboard shortcuts for deleting and retrieving the last deleted item.
|delete one character forward
|delete one word forward
|delete forward to end of line
|delete the line from the beginning to point
|retrieve last item deleted
CTRL+r search backward
When you hit CTRL+r the prompt change to
Type the first few characters of the command you have entered before, Bash completes the command line for you.
|Capitalize word after point
|Change word after point to all capital letters
|Change word after point to all lowercase letters
This is especially useful, when your caps lock is accidentally turned on and, you type something without realizing it.
Without the shortcut to change case, you would turn caps lock off, delete the characters you accidentally typed in
uppercase and then type them again. Now you are empowered with
|logout or close the terminal window
|cancel the currently running program or command
Spend some time with these keyboard shortcuts. Become a productive Bash user.