Pages

Tuesday, September 11, 2012

Another way to re-run the previous command



After running a command in the terminal, you can re-call it by simply hitting the up arrow button. Another way to recall the previous command you can use is to type the double exclamation marks ("!!"). In other words, when you run the double exclamation marks in the terminal, the previous command will be executed. This tip can be quite handy when you want to re-run the previous command as root. For example, instead of re-typing the whole previous command with 'sudo' or 'beesu' before it, you can just type:

 sudo !!  

or
 beesu !!  

You can look at the example image below to see how this works:

No comments:

Post a Comment