Last updated:
💻 Geeky Vibes! Check out our partner WrinkledT: Sustainable Style With a POP 💥 🌈 for the Soul (and the Planet!) 🌎💚

Have you ever forgot a command syntax while working in your Bash shell?

GNU Bash is the GNU command-line interface shell project with a complete implementation of the IEEE POSIX specification. It is one of the most used command-line shell. However, it may be overwhelming to know or remember all the possible commands at times.

This post includes a cheat sheet to help you get back to work quickly or improve your workflow. Some of the material covered in this current version include wildcards, escape keys bounds, tabs keys bounds, controls keys bounds, and alt keys bounds.

The cheat sheet is also available in an easy-to-print pdf and jpg format, or support this blog with the poster size Bash references cheat sheet.

Bash Cheat Sheet

Note: Use exec bash to reload your current bash shell. See my post on How To Reload Or Change Your Current Shell?

Wildcards

*match all characters
?match a single character
[]match a range of value
{}match a list of value

Examples:

You can learn more about bash wildcards with my post on How To Use Bash Wildcards For Globbing?

Escape keys bound (ESC+key)

esc+ddelete from the cursor position to the end of the word
esc+fmove forward a word
esc+bmove backward a word
esc+ttranspose two adjacent words

Tabs keys bound (TT=TAB twice)

TTlist all available commands
(string) TTlist all available commands starting with (string)
/TTlist available dir (including hidden ones, use /*TT otherwise)
~TTlist all system users
$TTlist all system variables
@TTlist hosts
=TTact as ls or dir

Control keys bound (CTRL+key)

ctrl+amove your cursor to the beginning of the line
ctrl+emove your cursor to the end of the line
ctrl+kdelete any characters from your cursor to the end of the line
ctrl+udelete any characters from your cursor to the beginning of the line
ctrl+wdelete previous word
ctrl+ttranspose two previous characters
ctrl+yyank/recover the last deletion
ctrl+ddelete one character at the cursor position
ctrl+hdelete one character before the cursor
ctrl+fmove forward
ctrl+bmove backward
ctrl+rfind character sequence in history (completion mode)
ctrl+gescape from completion mode
ctrl+vLiteral next (LNEXT)

👉 LNEXT interpret the next character as a string. eg : to symbolize a CR+LF you must use the key combination ctrl+v+return which will print ^M.

Alt keys bound (ALT+key)

alt+<move to the first line of history
alt+>move to the last line of history
alt+?show current completion list
alt+*insert all possible completion
alt+/attempt to complete filename
alt+.yank last argument to previous command
alt+bmove backward
alt+ccapitalize the word
alt+ddelete word
alt+fmove forward
alt+lmake word lowercase
alt+nsearch the history forwards nonincremental
alt+psearch the history backwards nonincremental
alt+rrecall command
alt+tmove word around
alt+umake word uppercase
alt+backspacedelete backwards from cursor
💻 Geeky Vibes! Check out our partner WrinkledT: Sustainable Style With a POP 💥 🌈 for the Soul (and the Planet!) 🌎💚
GET UNIQUE TIPS AND THE LATEST NEWS BY SUBSCRIBING TO MY NEWSLETTER.
AND FOLLOW ME ON