//View Tip #497
Similar Tips
» Bash terminal size
» Create a Terminal Calculator
» Deleting whole words on a bash command line
» Splitting arguments with read
» Filter stderr for cron jobs


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 »


Add your comment

Comments are currently disabled
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
<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