I've recently immigrated from Ubuntu to Mac OSX Snow Leopard. I use the terminal (iterm2) extensively, and I am a great fan of shortcut keys.

The standard shortcut keys (which work in any GUI textbox) are:

  • + Jumps to first character in line
  • + Jumps to last character in line
  • + Moves one word forward
  • + Moves one word backward

How can I impose these shortcuts in iterm (or terminal)?

Are there any standard key bindings for these operations in Mac I should know and use?

  • iTerm > Prefs > Keys lets you customize your keybindings and shortcuts.
    – user588
    Feb 1, 2012 at 13:40

3 Answers 3


The standard shell shortcuts (M- = meta = option or esc, C- = control):

  • M-b and M-f correspond to ⌥← and ⌥→
  • C-a and C-e correspond to ⌘← and ⌘→

⌥← and ⌥→ are bound to M-b and M-f by default on Lion's Terminal. On 10.6 you'll have to add them manually:

enter image description here

I haven't found any way to reassign ⌘← and ⌘→ in Terminal.

  • +1 Thanks. What does `\033b' stand for? Do you know how can I change this on iterm?
    – Adam Matan
    Feb 1, 2012 at 11:17
  • A few other useful shortcuts: C-w will kill the previous word. C-k will kill from the current cursor point to the end of the line. C-y will yank back what was previously killed.
    – cm2
    Feb 1, 2012 at 18:00
  • 1
    The '\033' is an escape sequence for the "escape key" on the keyboard, which is essentially the meta key that @Lri mentioned. So '\033b' is essentially M-b and '\033f' is essentially M-f. See, for example, hints.macworld.com/article.php?story=20100716230217548
    – cm2
    Feb 1, 2012 at 18:10

For iTerm2 you can customize hotkeys easily. A similar question was asked here

How can I move through words when typing a command in iTerm2?


You'll also find Ctl-e (end of line), Ctl-a (start of line), and Esc-d (delete word from cursor) work nicely in terminal and other apps, too (along with Ctl-k and Ctl-y mentioned above), as does repeat-letter (Esc-NNN d; Esc-22 d for example to output 22 letter d's). In fact, most of the keyboard shortcuts I've tried from other Unix distributions have worked in OS/X.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .