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 create a directory such that anyone in the group can create a file and access any person's file in it but none should be able to delete a file other than the one created by himself.
What is bourne shell scripting?
Which shell is the best?
Determine the output of the following command: name=shubham && echo ‘my name is $name’.
What does $@ mean in shell?
What is sudo command?
I have 2 files and I want to print the records which are common to both.
What are the advantages of shell script?
Explain about shebang?
What are zombie processes?
What does echo $0 do?
how will you find the total disk space used by a specific user?
What is shell and terminal?
How to print pid of the current shell?
How does path variable work?