In a single command how do you run the previous command in
the command prompt.
Answers were Sorted based on User's Feedback
Answer / kalaivani
type "r". It will execute the last executed command
| Is This Answer Correct ? | 7 Yes | 2 No |
Answer / anjan raha
!!
It will display previous executed command
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / namrata
Using Dot(.)It will execute the last executed command.
| Is This Answer Correct ? | 3 Yes | 1 No |
Answer / 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 |
How to create environment variables?What are the conditions for creating variables?
What is a shell script? Can you name some of its advantages?
What are the advantages of bash over all other shells?
what is the meaning of First line of shell script ,what is meaning of #! pleas explain brifly
write a program to display all the files from the current directory which are created in particular month
Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.
Please give me example of " at command , contrab command " how to use
c program which accept one argument as a directory name and prints all the file name along with its inode number and total count of the file in directory
What is Path variable?What is its use?
How to find duplicate record in file using shell script?
0 Answers IBM, Saama Tech, Wipro,
Which shell is the best?
How can I Debug a shell scripts and Perl scripting?? or How do you debug a shell scripting and perl scripting ( at the compile time error or run time error) in Unix environment ?