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 do you rename the files(*.sh) with file names containing space in it?for example "interview question.sh" needs to rename to "interview-question.sh". Appreciate your inputs.Thanks.

5 Answers   Wells Fargo,


What is the difference between bash and shell?

0 Answers  


State the advantages of shell scripting?

0 Answers  


If one dont know how to create a script then how he/she can use the QTP?

1 Answers  


What does it mean by #!/Bin/sh or #!/Bin/bash at the beginning of every script?

0 Answers  






How do scripts work?

0 Answers  


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

0 Answers  


Hello all, This is my assignment on shell scripting, can anyone help me regarding this ? Create a shell script which connects to the database In second shell script include the first script for the DB connection Create a table (PRADEEP_DATA) with 2 columns (name, value) In Third shell script include the first script for the DB connection And insert/delete the values from the Table, by accepting input from the user This functionality should be a menu driven Program: 1) Insert to the database a. Name b. value 2)Delete from the database a.Name b.value Exception handling needs to be taken care.

0 Answers   Cap Gemini, Wipro,


What does chmod do?

0 Answers  


Explain about shebang?

0 Answers  


What is an inode block?

0 Answers  


Write a command sequence to find all the files modified in less than 2 days and print the record count of each.

0 Answers  


Categories