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
I want to connect to a remote server and execute some commands, how can I achieve this?
What is the first line in a shell script?
Explain about non-login shell files?
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.
What does the sh command do?
What is bash eval?
What is the equivalent of a file shortcut that we have a window on a linux system?
What are the advantages of shell scripting?
shell script for reverse the string
I want to monitor a continuously updating log file, what command can be used to most efficiently achieve this?
madhar chod unix ke 10 commands dhang se likh nahi sakta hai
What is wc in shell script?
What is the difference between scripting and coding?
What happens when you type ls?
What is the syntax of "nested if statement" in shell scripting?