//View Tip #497
Similar Tips
» Disable bash history
» Version all unversioned files in an SVN checkout
» Checksum directory recursively
» Get latest stable version of the Linux kernel
» SSH Auto Complete

 

Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
<esc>-. (that's 'escape' followed by '.') inserts the last arguments from your last command. It comes in handy more than you think.

cp file /to/some/long/path
cd <esc>-.

This can be more useful than using '!!' as the argument can be edited after insertion.


View Comments »




Comments 

Add your comment

Comments are currently disabled
Brad
I have always like !$ better.

cp file /to/some/long/path
cd !$
Posted 2009-01-27 17:59:45
With <alt>+. you can go through the history of last arguments.

touch hello
touch bye
rm <alt>+. <alt>+. (removes 'hello')
Posted 2009-01-27 19:35:14
Nick
<esc>-. can also let you go through this history of last arguments.
It seems that <alt>+? = <esc>-?
For example: <alt>+g = <esc>-g, and <alt>+. = <esc>-.
Posted 2009-01-28 12:02:51

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit