Friday, March 20, 2009

Bash Commands

Ctrl + xx Move between EOL and current cursor position

Ctrl-a Move to the start of the line.
Ctrl-e Move to the end of the line.

Ctrl-b Move back one character.
Ctrl-f Move forward one character.

Alt-b Move back one word.
Alt-f Move forward one word.

Alt-] x Where x is any character, moves the cursor forward to the next occurance of x.
Alt-Ctrl-] x Where x is any character, moves the cursor backwards to the previous occurance of x.

Ctrl-u Erase the current line.
Ctrl-k Delete from the cursor to the end of the line.
Ctrl-w Delete from the cursor to the start of the word.
Esc-Del Delete previous word (may not work, instead try Esc followed by Backspace)
Alt + d Delete word

Ctrl-y Pastes text from the clipboard.
Ctrl-l Clear the screen leaving the current line at the top of the screen.

Ctrl-x Ctrl-u Undo the last changes. Ctrl-_ does the same
Alt-r Undo all changes to the line.
Ctrl-d Delete from under the cursor
Ctrl-r Search the history backwards
Ctrl-R Search the history backwards with multi occurrence
Ctrl-xx Move between EOL and current cursor position
Ctrl-x @ Show possible hostname completions

Alt-< Move to the first line in the history
Alt-> Move to the last line in the history
Alt-? Show current completion list
Alt-* Insert all possible completions
Alt-/ Attempt to complete filename
Alt-. Yank last argument to previous command
Alt-back-space Delete backward from cursor

2T = TAB twice
/2T Entire directory structure including Hidden one
*2T Only Sub Dirs inside without Hidden one

Alt-n Search the history forwards non-incremental
Alt-p Search the history backwards non-incremental

Alt-t Move words around
Alt-u Make word uppercase
Alt-l Make word lowercase
Alt-c Capitalize the word

No comments:

Post a Comment