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 do you write sql queries using shell script for eg:- we have databae table like EMPNO,ENAME,SAL,DEPTNO columns in EMP table how you display EMPNO,SAL FIELDS from emp in SHELL SCRIPT please explain with an example
write a shell script that counts a number of unique word contained in the file and print them in alphabetical order line by line?
What is MUTEX?
Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.
A file has multiple records each having three 30-bit long fields(field1,field2,field3).There is also a lookup file,LOOK_UP.dat.Now, we need to consider only the last ten digits of field1 and lookup the file LOOK_UP.dat. If there a match then field2 and field3 should replaced with corresponding data from the lookup file. otherwise that particular record,for which there is no match, should be stored in a seperate file.
How do I open the shell in cmd?
I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?
What is the equivalent of a file shortcut that we have a window on a linux system?
How to group the commands in shell scripting?
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.
Why do we write bin bash in shell scripts?
how to print the matrix form of 2-d, 3-d arrays in unix c shell scripts ?