Thursday, October 11, 2007

You can always have the Last Word In ..

!$ is a handy shorthand for the last word in the previous command.

At first, it may not seem that useful.

But wait, ...

cd somedir
cp some_file_a /some/long/dir/path/some_file_b

Now you want to edit some_file_b

Just type
vi !$

That translates to vi /some/long/dir/path/some_file_b

It saves quite a bit of typing. Not bad.

No comments: