Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

How do I do a bang command to repeat last line, but with changed last argument?

share|improve this question
    
geekology.co.za/blog/2009/02/… – joe Oct 2 '09 at 13:25
    
I guess there are other uses than just ease of typing, but <Up> <Home> "sudo " <Enter> is as many key presses as "sudo !!" <Enter> (even fewer if one counts the <Shift> to get !), and more general. Similar combinations also nullifies other uses of the !! operator, in my experience. – Daniel Andersson Mar 26 '12 at 15:10
up vote 6 down vote accepted

Try:

!!:0- new_last_argument

See this article for an overview.

share|improve this answer
    
I couldn't tell from the article whether that was substituting or appending new_last_argument for old_last_argument. At the bottom of the link there's a cheat sheet that spells it out. Good reference! – quack quixote Oct 2 '09 at 14:15

You must log in to answer this question.

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