Bash Keyboard Shortcuts

Keyboard Shortcuts

Purpose

Ctrl + A

Go to the beginning of the line you are currently typing on

Ctrl + E

Go to the end of the line you are currently typing on

Ctrl + F

Forward one character

Ctrl + B

Backward one character.

Meta + F

Move cursor forward one word on the current line

Meta + B

Move cursor backward one word on the current line

Ctrl + P

Previous command entered in history

Ctrl + N

Next command entered in history

Ctrl + L

Clears the screen, similar to the clear command

Ctrl + U

Clears the line before the cursor position. If you are at the end of the line, clears the entire line.

Ctrl + H

Same as backspace

Ctrl + R

Lets you search through previously used commands

Ctrl + C

Kill whatever you are running

Ctrl + D

Exit the current shell

Ctrl + Z

Puts whatever you are running into a suspended background process.fg restores it.

Ctrl + W

Delete the word before the cursor

Ctrl + K

Kill the line after the cursor

Ctrl + Y

Yank from the kill ring

Ctrl + _

Undo the last bash action (e.g. a yank or kill)

Ctrl + T

Swap the last two characters before the cursor

Meta + T

Swap the last two words before the cursor

Tab

Auto-complete files and folder names

Advertisements

2 thoughts on “Bash Keyboard Shortcuts

  1. I think this is purely dependent on the editor that is used with bash. You can do “set -o vi” and use ViM keybindings.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s