Cheatography
https://cheatography.com
Shortcuts for bash shell.
bash - Movement
Ctrl + a go to the start of the command line
|
Ctrl + e go to the end of the command line
|
Ctrl + xx (toggle) beginning of line/cursor position
|
Alt + b previous word begin
|
Alt + f next word end
|
Ctrl + f forward one character
|
Ctrl + b back one character
|
bash - Manipulation
Alt + c from cursor, capitalize to end of word
|
Alt + u from cursor, uppercase to end of word
|
Alt + l from cursor, lowercase to end of word
|
Alt + t transpose word with previous word
|
Ctrl + t transpose character with previous character
|
|
|
bash - Command Control
Ctrl + l clear screen
|
Ctrl + s stops screen output (for verbose commands)
|
Ctrl + q allow screen output (undo Ctrl+S)
|
Ctrl + c terminate command
|
Ctrl + z suspend command/send to background (use fg to bring forward)
|
bash - Command Recall
Ctrl + r search history backward
|
Ctrl + g escape from history search mode
|
Ctrl + p previous command in history (walk back)
|
Ctrl + n next command in history (walk forward)
|
Alt + . last word of previous command
|
|
|
bash - Cut/Paste/Delete
Ctrl + u from cursor, delete to start of line
|
Ctrl + k from cursor, delete to end of line
|
Ctrl + w from cursor, delete to start of word
|
Alt + d from cursor, delete to end of word
|
Ctrl + d delete character under cursor
|
Ctrl + h delete character before cursor
|
Ctrl + y after cursor, paste cut/deleted text
|
bash - Bang (!) Commands
!! run last command
|
!foo run most recent command starting with 'foo'
|
!foo:p print most recent command starting with 'foo'
|
!$ last word of previous command (Alt + .)
|
!* previous command without last argument
|
!*:p print previous command without last argument
|
|
Created By
Metadata
Favourited By
and 10 more ...
Comments
TME520, 00:08 26 Nov 15
4 stars because I think the letters should be lowercase. Great work otherwise !
karaliking, 16:11 1 Feb 16
In addition to the cases of letters, I believe the last 2 bang commands are not right.
!* stands for all the arguments of previous command, !*:p prints them. It does not run the previous command without arguments. Could be the version of bash?
Add a Comment
Related Cheat Sheets
More Cheat Sheets by CITguy