In a single command how do you run the previous command in
the command prompt.

Answers were Sorted based on User's Feedback



In a single command how do you run the previous command in the command prompt...

Answer / kalaivani

type "r". It will execute the last executed command

Is This Answer Correct ?    7 Yes 2 No

In a single command how do you run the previous command in the command prompt...

Answer / asit

esp + p enter
upper arrow enter

Is This Answer Correct ?    7 Yes 4 No

In a single command how do you run the previous command in the command prompt...

Answer / anjan raha

!!

It will display previous executed command

Is This Answer Correct ?    4 Yes 1 No

In a single command how do you run the previous command in the command prompt...

Answer / namrata

Using Dot(.)It will execute the last executed command.

Is This Answer Correct ?    3 Yes 1 No

In a single command how do you run the previous command in the command prompt...

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

Post New Answer

More Shell Script Interview Questions

What is a shell in operating system?

0 Answers  


How to find duplicate record in file using shell script?

0 Answers   IBM, Saama Tech, Wipro,


What does $0 mean in shell script?

0 Answers  


Is SSO and SSL support BOXI?

2 Answers  


How to pass an argument to a script?

0 Answers  


write a shell script to identify the given string is palindrome or not?

17 Answers   CTS, HP, IBM, InfoEst, Wipro,


What are the advantages of shell script?

0 Answers  


What are the 4 basics of OOP?

1 Answers   Amazon, Infosys,


What is the meaning of $1 in shell script?

0 Answers  


Set up a Sev 2 alert when the Primary WA service fails. A windows batch script needs to be created that will monitor the WA service on the Primary and when the service stops/fails a Sev 2 TT is generated for a particular team ?

0 Answers   TCS,


What is the crontab?

0 Answers  


write a shell script to find the largest number from 3 given numbers.

6 Answers  


Categories