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

How to add some content in any file at some desired location without using VI or some other editor in UNIX

2 Answers  


How to debug the problems encountered in the shell script/program?

0 Answers  


How do I start a shell script?

0 Answers  


How can I send a mail with a compressed file as an attachment?

0 Answers  


What is the syntax of "nested if statement" in shell scripting?

0 Answers  






is there any command to find user password?

4 Answers  


Can we run shell script in windows?

0 Answers  


What is a batch file used for?

0 Answers  


Why do we write bin bash in shell scripts?

0 Answers  


What is the best scripting language?

0 Answers  


State the advantages of shell scripting?

0 Answers  


how will you find the total disk space used by a specific user?

0 Answers  


Categories