Keyboard shortcuts for Bash

PDF

The BASH shell has some build-in commandline keyboard shortcuts. Some of them might not work if you are logged in through ssh, it depends on how the keys are mapped.

 

- tab: commandline completion
- up/down arrow: move thru the bash command history
- right arrow or ctrl+f: move forward
- left arrow or ctrl+b: move forward
- alt+f: move forward a word
- alt+b : move backward a word
- ctrl+a: move your cursor to the beginning of the current line
- ctrl+e: move your cursor to the end of the current line
- ctrl+w : delete previous word
- esc+d : delete from the cursor position to the end of the word
- ctrl+k : delete everything from the cursor position to the end of the line
- ctrl+u : delete everything from the cursor to the beginning of the line
- ctrl+h : delete one character before the cursor
- ctrl+y: recover (yank) the last deletion
- ctrl+t: swap two previous characters
- esc+t: swap two previous words
- alt+u: capitalize every character from the cursor to the end of the current word.
- alt+l: lower the case of every character from the cursor to the end of the current word.
- alt+c: capitalize the character from the cursor position and move to the end of the word.
- alt+r: undo the changes and restore the line as it was in the history
- ctrl+l: clear screen
- ctrl+c: kill
- ctrl+z: move the process to the background (bg)
- ctrl+d: exit current shell

Tags:
 

Please login first before adding a comment.

Search






You are here: Home Howtos and FAQs Bash Keyboard shortcuts for Bash