Brainscape Bash Flashcards
search history forward/backward
CTRL-R / CTRL-S (mnemonic: Reverse history search, Search [forward])
cancel history search
CTRL-G (mnemonic “Get out of here”)
cycle through final parameter of previous commands
ALT-.
cycle through completions (set manually)
ALT-S
go to beginning/end of line
CTRL-A / CTRL-E
go to previous / next command in history
CTRL-P / CTRL-N
move forward/backward (right/left) one word
ALT-F / ALT-B
toggle between beginning of line and current character position
CTRL-XX
clear whole screen, similar to “clear” command
CTRL-L (mnemonic “cLear”)
delete word backward / forward
ALT-Backspace / ALT-D
cut word before/after cursor to clipboard
CTRL-W / CTRL-K (mnemonics, backward just like Vim, CTRL-K “Kill”)
cut the whole line before the cursor to clipboard
CTRL-U
paste the last thing to be cut
CTRL-Y
swap current word with previous
ALT-T
undo
CTRL-_
revert the line to the way it was in history
ALT-R (mnemonic: “Revert”)
how to make a tag on a command in history
just use “#tag”–anything after the tag is a comment, but will be retained in history
how to change to the previous directory
cd -
how to use the previous directory in a command
can be specified with “~-“ (e.g. “tar xzf ~-/moz”)
view all history
history
view last five commands of history
history 5
search history for all commands with “cd” in them
history | grep cd
how to do a reverse-i-search with text you’ve already entered
CTRL-aryr
history for previous command name
!!:0