Bash Commands Cheatsheet
Bash Command Line Navigation
Move Cursor to Start of the Line
Ctrl + a
Move Cursor to End of the Line
Ctrl + e
Bash Directory Management
Return to Previous Directory
cd -
Bash Command History and Search
Find Previous Command (Reverse Search)
Also known as reverse-i-search. Type part of the command you're looking for after pressing the keys.
Ctrl + R <search_term>
Bash Input Redirection
Here-Document for Multi-line Input
Allows you to redirect multiple lines of input to a command.
$ wc << EOF
one two three
four five
EOF
Output:
2 5 24
See also "here-string" for single-line input:
command <<<$word
General Bash Productivity Tips
This Bash cheatsheet provides quick access to essential commands for navigating the command line, managing directories, searching command history, and handling input/output. Mastering these fundamental Bash commands can significantly boost your productivity when working in a Linux or Unix-like environment. For more advanced scripting and shell features, consult the official Bash documentation.
External Resources: