Easily Correct a Typo of Previous Command Using Carat (^) Symbol

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Gabriel Cánepa

Gabriel Cánepa is a GNU/Linux sysadmin and web developer from Villa Mercedes, San Luis, Argentina. He works for a worldwide leading consumer product company and takes great pleasure in using FOSS tools to increase productivity in all areas of his daily work.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

Receive Your Free Complimentary eBook NOW! -

Download Free Linux eBooks

Linux BASH Programming Cookbook
Getting Started with Ubuntu 16.04
A Newbie's Getting Started Guide to Linux
Introduction to Linux - A Hands on Guide

You may also like...

9 Responses

  1. DannyB says:

    This would be very handy if your previous command was:

    rm -rf /

    but what you really meant was:

    rm -rf /home/danny/junk

  2. Wilson says:


    (I can’t take credit. A friend of mine that I shared this with pointed it out.)

    • Gabriel A. Cánepa says:

      That is correct. Thank you for bringing this to our attention.
      Please correct the typo in the title.

      • Ravi Saive says:


        Say thanks to your friend who pointed out this typo, really appreciated…:)


        Corrected in the writeup…

  3. jamie says:

    $ Carat
    $ ^at^et

  4. Gabriel A. Cánepa says:

    Feel free to use this tip if it is helpful. If you feel more comfortable using the arrow keys and correcting the command, feel free to do so as well. This was just a tip :)

  5. Peter says:

    Very good to know! Thanks a lot! We can even do more simpler than that.
    For instance:
    $ nestat -npltu | grep 22
    $ ^ne^net

  6. Phil b says:

    I see the benefit if you are using many pipes or parameters, but it still only works for the most recent command. I think I would still simply use the up arrow once and a correction rather than typing the carat mistype, carat, and correct command.

  7. Phil b says:

    Seems like it would be simpler to type the correct command. Instead of a carat, the mistype, a carat, and then the correct command

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

Join Over 300K+ Linux Users
  1. 177,942
  2. 8,310
  3. 37,548

Are you subscribed?