Bash: Maneuver Around Command Line Efficiently

The command line is powerful with all of its commands, yet over time the tasks can get tedious and repetition. Learning the hotkeys can greatly expedite the process.

HotkeyAction
Ctrl+AGo to beginning of line
Ctrl+EGo to end of line
Ctrl+Left
Ctrl+Right
move around words
Ctrl+UDelete from beginning of line to current character (inclusive)
Ctrl+KDelete from current character to end of line (inclusive)
Ctrl+WDelete previous word (space-separated)
Ctrl+R Search for past command containing
Subsequent arrow key ends the search and replace with
Up: previous command in history
Left or Right: searched command
Down: Next command
From then on Up/Down would cycle through with relation to this command

Repeat Ctrl+R to keep searching
Repeat
Alt+Shift+#Cancel current command but save it into history prefixed by "#"

Leave a Reply

Your email address will not be published. Required fields are marked *