Knowing how to quickly manipulate the command line in the BASH shell will save you a lot of time and frustration. Here are 10 Simple key combinations that will make your life easier and speed up your line editing skills.
CTRL + a – Places your cursor at the beginning of the line you are on
CTRL + e – Places your cursor at the end of the current line you are on
CTRL + u – Clears the line of everything BEFORE the cursor
CTRL + k – Clears the line of everything AFTER the cursor
CTRL + d – Deletes the character under the curser
CTRL + p – Goes back a previous command in history. This is the same as using the up arrow.
CTRL + n – Goes forward a command in history. This is the same as using the down arrow.
ALT + f – Move forward one word
ALT + b – Move backward one word
ALT + . – Inserts the last word from the previous history entry