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

This happens to me all the time: I type a long command line and forget to specify some options. For example:

$ tcpdump host and port 8080

Hmm, I should be seeing some output. Ah! Forgot to listen on a different interface.

At this point I'd hit the up-arrow to bring back the previous command, then either scroll back to the first argument or press C-a to jump to the start of the command and scroll forward to the first argument.

Is there a quicker way to jump to the first argument so I can insert the -i eth1 option?

share|improve this question
up vote 3 down vote accepted

I believe the closest shortcut without key rebindings is CTRL-A, ALT-F (ESC-F in Mac).

share|improve this answer

Command line editing can be done using either emacs style commands or vi style commands. The default is emacs (See Jin's answer).

If you are more used to vi than emacs you can switch this editing mode in your ~/.bashrc file by adding set -o vi Then you can use any vi commands you are familiar with

Esc, 0, e, a (start of line, end of word, append)
Alt+0, w, i (start of line, next word, insert)
Alt+5, B, i (go back 5 words, insert)
Alt+F, h, i (find "h" going backwards, insert).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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