Shell Programming Blog Shell Programming Blog

Sunday 14 October 2012

Linux bash scripting: How to repeat the previous command quickly in the Linux command line

Unknown | 11:32 | |


There are four different ways by which we can repeat the previous commands that we executed in the command line.

1) use the "UP arrow" to view the previous command and press Enter to execute it.
2) Type !! and press enter from the command line
3) Type !-1 and press enter from the command line.
4) Press Control+P to display the previous commands. You can keep pressing the Ctrl+P to older commands. When you see the required command you can press enter to execute it

0 Comments:

   

Post a Comment

Don't just read and walk away, Your Feedback Is Always Appreciated. I will try to reply to your queries as soon as time allows.

Note:
1. If your question is unrelated to this article, please use our Facebook Page.
2. Please always make use of your name in the comment box instead of anonymous so that i can respond to you through your name and don't make use of Names such as "Admin" or "ADMIN" if you want your Comment to be published.
3. Please do not spam, spam comments will be deleted immediately upon my review.

Regards,
Mohamed Abubakar Sittik A

 

Shell Programming Copyright © 2012 Shell Programming theme is Designed by Abusittik, Shell Programming