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
What are "c" and "b" permission fields of a file?
Explain about return code?
What does $@ mean in shell?
shell script for reverse the string
How do I run a script from command prompt?
How to redirect both standard output and standard error to the same location?
What is meant by dos operating system?
What are the different variables present in linux shell?
What does $@ mean bash?
How can the contents of a file inside jar be read without extracting in a shell script?
What language is shell scripting?
What are the disadvantages of shell scripting?
Is shell scripting difficult?
How do I open a jshell in cmd?
What are the different commands available to check the disk usage?