5

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

2
  • geekology.co.za/blog/2009/02/…
    – joe
    Oct 2, 2009 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. Mar 26, 2012 at 15:10

1 Answer 1

8

Try:

!!:0- new_last_argument

See this article for an overview.

1
  • 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! Oct 2, 2009 at 14:15

You must log in to answer this question.

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