In a single command how do you run the previous command in
the command prompt.
Answers were Sorted based on User's Feedback
Answer / kalaivani
type "r". It will execute the last executed command
| Is This Answer Correct ? | 7 Yes | 2 No |
Answer / anjan raha
!!
It will display previous executed command
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / namrata
Using Dot(.)It will execute the last executed command.
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / joker
!! will execute the last command
!-1 will execute the 2nd command from last
Few other tricks:
-----------------
If you are not sure you can see what is the command rather than executing by
!!:p
!-2:p
and later just do !!
If you want to run the last command with little modification use substitution
!!:s/old/new
example:
>vim test
>!!:s/test/abcd/:p
vim abcd
Thanks,
Joker
| Is This Answer Correct ? | 0 Yes | 0 No |
Is powershell a language?
What is in a script?
What happens on a system call?
What is shell variable?
How to sort a result of Ls -l command based on columns. Ex. i want to sort 5th column from output of ls -l command.
I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?
What is the use of a shebang line?
c program the catches the ctrl-c(SIGINT) Signal for the first time and prints a output rather and exit on pressing Ctrl-C again
How do we create command aliases in a shell?
Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.
Explain about login shell?
write a shell script to identify the given string is palindrome or not?
17 Answers CTS, HP, IBM, InfoEst, Wipro,