views:

37

answers:

2

HI,

when using unix i use to type !! to run the last executed command.

how could i do the similar kind of operation on dos prompt on windows?

+1  A: 
Paolo
but this is not a shell-alone feature, on some terminal the up arrow could be not useful (rare, but...); while the `!!` is an internal shell command that can have also other usages (btw uparrow followed by enter works for all other shells having history and terminal allowing the key), e.g. `for e in 1 2 3 4; do !!; done`
ShinTakezou
Agree, but that's not what the OP was asking for. If you want to get fancy and execute !! equivalent in a script like your example you'd need to look at Powershell or install Cygwin.
Paolo
+1  A: 

You can also use F7 to navigate the command history. F1 will recover the last command character by character.

K. Claszen