Simple, but useful shortcuts in a bash shell. Not a complete list, but I find myself using these the most:

Editing

CTRL + a: Beginning of line

CTRL + e: End of line

CTRL + w: Delete current word

ALT + b: Backwards one word

ALT + f: Forward one word

CTRL + l: Clear screen

See this post to alter your Terminal to use CTRL + Left Arrow or CTRL + Right Arrow for moving between words on a Mac.

Cut and Paste

CTRL + u: Cut from current location to beginning of the line

CTRL + k: Cut from current location to end of line

CTRL + w: Cut from current location to beginning of word

CTRL + y: Paste copied / cut lines

History

CTRL + r: Type in a term to search command history

CTRL + g: Escape history searching

CTRL + p: Search backward

CTRL + n: Search forward

  • Categories
comments powered by Disqus