This post list commonly used keyboard shortcuts in Linux terminal.
- Auto Completion
It let’s you skip typing out a whole file name or folder name in the command line. It looks at all the information it has so far, and makes a guess about what you mean. For example, type
ls -l Do, and hit
Tab, and n. If Tab doesn’t have one clear suggestion to return, it will not autocomplete. In this case, pressing Tab again will list set of possibilities.
Auto complete also works with commands in Bash. It makes it handy to discover new commands or to refresh your memory if you only remember the first part of a command.
- Move cursor
To move the cursor around and edit commands or parameters, use the arrow keys for that.
- Move cursor to beginning of line
Control + A
- Move cursor to end of line
Control + E
- Move one word at at time
Ctrl+Left Arrow move backward one word at a time.
Ctrl+Right Arrow move forward one word at a time.
- Deletes from the cursor position to the beginning of the line
- Deletes from the cursor position to the end of the line
- Copy from command line
- Paste into command line
- Command Navigation
Use Up and Down arrows, which will which will go to commands that you typed in the shell. It works like navigating a list. Press up once and you’ll get to the previous command. Press up twice and it’s the second most recent. To go back down the list use down arrow.
- Search in Command history
Press Control + R, and start typing a command or path. Shell will show you what matches. You can use control + R again to cycle between matches.
- Abandon the command
Control + C
- Go to the previous working directory