You need to add "This is a bashism" somewhere in the whole thing.

-----Original Message-----
From: Carl Cerecke [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 9 March 2005 8:41 a.m.
To: CLUG
Subject: Tip of the day: Alt-. at the command line


When using the command-line, often the last argument to the previous 
command is required for the next command.

For example, the use of "out.pdf" in these to lines:

 > ps2pdf in.ps out.pdf
 > acroread out.pdf

After typing acroread, and a space, pressing Alt and then . (written as 
Alt-.) will bring up the last argument of the previous command: out.pdf

If the argument you actually wanted was further back in the history, 
then simply keep pressing Alt-. until you get to that argument.

Advanced use:
You can also give a numerical argument to Alt-. (indeed, any readline 
library command that wants one). For example,

Alt-3 Alt-.  gives you the 3rd argument of the previous command

Alt-0 Alt-.  gives you the previous command

Alt-Minus 2 Alt-.  gives you the 3rd (yes, 3rd) argument from the end



Also, often you want to erase words or parts of a word (say, just the 
extension "pdf") or directories in a long pathname. Alt-backspace is 
good for this.

Cheers,
Carl.

Reply via email to