bash Flashcards
Exit the history search.
ctrl + g
See the previous command in the history.
ctrl + p
See the next command in the history.
ctrl + n
Go to the beginning of the line in bash prompt
ctrl + a
Go to the end of the bash prompt line
ctrl + e
move cursor forward on bash prompt by 1 character
ctrl + f
move cursor backward on bash prompt by 1 character
ctrl + b
deletes forward to end of bash line
ctrl + k
deletes backwards to beginning of bash line
ctrl + u
delete backwards to the start of a word in bash prompt
ctrl + w
delete the character under the cursor in the bash prompt
ctrl + h
paste in the last item that you deleted or killed from the bash prompt, like when you ctrl + w, u, k, h, etc
ctrl + y
count words in a file
wc -w file
count lines in a file
wc -l file
count characters in a file
wc -c file
or
wc -m file … if you want to take multi-byte character sets into account