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

In bash, I frequently do


I want something like

vim !!

So how do I do that with a bash ! directive that eats the first word?

share|improve this question
You don't need to use touch since vim will create the file if it doesn't exist (after you :w of course). – styfle Jan 6 '12 at 6:19
You're right, bad example. In real life I am actually doing "touchmod", which is a personal alias that touches and then chmods u+x. – AlcubierreDrive Jan 6 '12 at 6:21
up vote 4 down vote accepted

!* will give you the everything in the previous command except the command itself.

!$ will give you the last parameter for the previous command.

Both should work in your example (a command with a single parameter).

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.