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 the use of "shift" command in passing parameters?

1 Answers  


is there any command to find user password?

4 Answers  


Is it possible to substitute "ls" command in the place of "echo" command?

0 Answers  


What is a shell made of?

0 Answers  


write a shell script to check whether all the directories in the path exist has read and write permission

1 Answers  






if i have 2 files file1 and file2.... file1 contains 2 columns like b a 11 aa 12 as 13 ad 15 ag 11 ar 13 ah 15 ak file2 contains b c 10 ds 11 at 15 gh 15 jk 13 iu 11 fg 13 yy can any 1 give me the program to display in this way? a b c aa 11 at ar 11 fg ad 13 iu ah 13 yy ag 15 gh ak 15 jk

3 Answers  


what is the difference between writing code in shell and editor?

1 Answers  


write a shell script to generate a alert ? like when ur birthday came then generate a alert ur birthday is today like that ?

0 Answers   Wells Fargo,


What is egrep?

2 Answers  


Why we are writting shell scripts? Plz if possible explain it briefly.

6 Answers   ITC Infotech,


How do you schedule a command to run at 4:00 every morning?

5 Answers   Wipro,


What is shell and terminal?

0 Answers  


Categories