views:

12

answers:

1

hello in unix command line !! will execute th eprevious command on the command line like below

indibm202 21: date
Tue Nov 10 17:38:13 IST 2009
indibm202 22: !!
date
Tue Nov 10 17:38:16 IST 2009
indibm202 23:

what is the command to execute the second previous command?

+1  A: 

If tcsh is anything like csh (and I think it is), you should be able to use:

!-2

to execute the second-last command (!! is equivalent to !-1). Alternatively, you could use history to check out your last few commands and just use:

!N

where N is the command number.

paxdiablo
thats coll pax...thanks