Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
How can I move around the bash commandline efficiently?

In the Windows prompt, one can go back or forward one word by pressing ctrl and <-/->. What's the equivalent in a bash environment?

share|improve this question

marked as duplicate by quack quixote, BinaryMisfit Mar 3 '10 at 12:19

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.

duplicate:… – quack quixote Mar 3 '10 at 11:51

There is M-b and M-f for moving backwards and forwards to the current word, respectively. Here M is the Meta or Esc key or a combination, like Ctrl+Meta. The section Commands for Moving in the bash manpage lists these and other shortcuts available for moving on the bash shell.

The manual also describes how to customize your bash settings so you can use your known Ctrl + / to skip words.

share|improve this answer
I tried Esc+b/f,not working . – user11671 Mar 3 '10 at 7:09
Try the Alt key as well. The meta key is also emulated with the alt or windows key on keyboards that have them. – ayaz Mar 3 '10 at 8:12
@user11671: Does bind -p|grep forward-word produce "\ef": forward-word (among other things)? – Dennis Williamson Mar 3 '10 at 10:28
Alt + Shift is the meta key on my Gnome terminal. – Matthias Braun Oct 10 '14 at 12:48
To directly answer the user's question, this works for me in ~/.inputrc in Ubuntu: # Assign Ctrl-right-arrow and Ctrl-left-arrow move to next/previous word "\e[1;5C": forward-word "\e\e[C": forward-word "\e[1;5D": backward-word "\e\e[D": backward-word source: – dougkramer Oct 20 '14 at 22:13

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