bash Shortcuts Cheat Sheet

A Software › Linux cheat sheet in English by CITguy

Shortcuts for bash shell.

61,851 views 13,119 downloads 11 Feb 2013 History
4.8 avg · 12 ratings

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/c­ursor position
Alt + b
previous word begin
Alt + f
next word end
Ctrl + f
forward one character
Ctrl + b
back one character

bash - Manipu­lation

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 comman­d/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/Pa­ste­/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/de­leted 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

Badges

Useful Cheat Sheet Great Cheat Sheet Nice Cheat Sheet Good Cheat Sheet Appreciated Cheat Sheet Downloaded from Unusual Locations × 4

Comments (2)

karaliking 16:11 1 Feb 2016

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?

Reply
TME520 00:08 26 Nov 2015

4 stars because I think the letters should be lowercase. Great work otherwise !

Reply

Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.