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 is c in shell script?
What is the first line in every perl script called?
What is mac default shell?
Why are shell scripts used?
What is echo $shell?
What is awk in shell script?
How many fields are present in a crontab file and what does each field specify?
How important is shell scripting?
What are the various stages of a linux process it passes through?
What are filters explain sort with all the options available?
What are the zombie processes?
What are types of shells?
how to get part of string variable with echo command only?
Devise a script that takes file name as arguement(which must present in the current directory)and locates from your home directory tree all thpath names of its links.Then mail the list to self.
How to use arguments in a script?