Announcing:

LessMoney Conference will be June 7th in Tampa! Register today and make us smile super big!

Bash Tip

written by Steven on December 11, 2007

Try this:


> ls -al
drwxr-xr-x  23 steve  steve    782 Dec  9 00:27 .
drwxr-xr-x  39 steve  steve   1326 Dec 11 21:21
drwxr-xr-x  11 steve  steve    374 Dec 11 18:16 .svn
.......
> !!
drwxr-xr-x  23 steve  steve    782 Dec  9 00:27 .
drwxr-xr-x  39 steve  steve   1326 Dec 11 21:21
drwxr-xr-x  11 steve  steve    374 Dec 11 18:16 .svn
.......
> ls -al
drwxr-xr-x  23 steve  steve    782 Dec  9 00:27 .
drwxr-xr-x  39 steve  steve   1326 Dec 11 21:21
drwxr-xr-x  11 steve  steve    374 Dec 11 18:16 .svn
.......
> ls !$
drwxr-xr-x  23 steve  steve    782 Dec  9 00:27 .
drwxr-xr-x  39 steve  steve   1326 Dec 11 21:21
drwxr-xr-x  11 steve  steve    374 Dec 11 18:16 .svn
.......

 

So:

  • !! reruns the last command (very useful if you forget to put sudo in front: > sudo !!).
  • !$ gets the first param of the last command.
Learn how LessEverything built their consultancy to over $1,000,000 annual revenue at LessMoney Conference, June 7th in Tampa Florida. Each attendee will get early access to our upcoming ebook as well.

Leave a Comment

About Steven
Steven Bristol has written code for the past 20 years. He like green vegetables and kittens, oh and butterflies too. He loves to throw ninja stars at his enemies.

You Should...

Follow Steven on Twitter
Friend Steven on Facebook
Subscribe
LessEverything Copyright 2011 LessEverything.com
We don't like footers, they're kinda boring