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 |
how to search for vowels a,e,i,o,u appearing in the same sequence in a file
How important is shell scripting?
What is the command to find out today's date?
Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.
What is the use of echo in shell script?
why did you apply to shell
How to write an Auto scripting for deleting old files using shell script and made a cron job to run on daily basis
wats the she bang statment with syntax?
Is scripting and coding the same thing?
Explore about environment variables?
What is the difference between bash and shell?
Hi, I want to practise Unix korn shell scripting which i learnt 2 yr bfr. plz suggest software i can use to practise.