Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Possible Duplicate:
How to change previous/next word shortcut in bash?

When connected to a ubuntu server bash shell, I can hold alt key and press the left or right keys to move forward or backward a word. It is incredibly useful.

Is this behaviour defined in the .bash_profile or can it be? I.e. can I bring this behaviour into my OSX shell?

share|improve this question
add comment

migrated from serverfault.com Apr 26 '12 at 16:30

This question came from our site for professional system and network administrators.

marked as duplicate by Gilles, Renan, Stéphane Gimenez, Ulrich Dangel, jasonwryan Aug 23 '12 at 1:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

Put this into your ~/.bash_profile:

bind '"\M-\e[C":forward-word'
bind '"\M-\e[D":backward-word'

Checked on OS X Lion.

share|improve this answer
    
I can't get this to work... could I be missing something else? –  Ross May 2 '12 at 14:36
    
Can you paste here output of this command: fgrep ard-word $HOME/.${SHELL##*/}_profile? –  Rudolf Adamkovic May 2 '12 at 18:25
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.