In a single command how do you run the previous command in
the command prompt.
Answer Posted / 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 |
Post New Answer View All Answers
Differentiate between ‘ and ” quotes.
What is a shell environment?
Is cmd a shell?
Can we run shell script in windows?
Set up a Sev 2 alert when the Primary WA service fails. A windows batch script needs to be created that will monitor the WA service on the Primary and when the service stops/fails a Sev 2 TT is generated for a particular team ?
Is shell scripting a language?
What is inside a seashell?
What are script files?
Is shell a part of kernel?
Where are cowrie shells found?
Which shell is the best?
Is shell scripting useful?
What is the significance of the shebang line in shell scripting?
How do I debug a shell script?
How do we create command aliases in a shell?