Navigating the Command Line in Terminal.app
I recently switched back to using Apple’s built in Terminal.app (I was using iTerm previously) program for all of my command line needs. There are tons of keyboard shortcuts when you’re using bash but there are a few that are especially handy to have memorized.
- CTRL-A: Goes to the beginning of the line
- CTRL-E: Goes to the end of the line
Sometimes you want to get to the middle of the line instead of heading to the beginning or to the end. These will help:
- OPTION/ALT-B: Jumps cursor back
- OPTION/ALT-F: Jumps cursor forward
There is one caveat though. The first time I tried the OPTION key trick, the Terminal would just type in strange characters. In order to get Terminal to recognize the OPTION/ALT key as a command key you have to check the option for “Use option as meta key” in the preferences pane of the Terminal app. Once that is done, the Option key shortcuts will work.

Thanks to Alex (aka @demonbane) for showing me this trick.
There are ton of shortcuts for the bash shell but these are among my favorites/most used.