macOS: how to fix typos on Terminal?

macOS: how to fix typos on Terminal?

When using Terminal on your Mac, do you often make typos? Not surprisingly, this utility is nowhere near as forgiving as Word and other text editors. 

Fortunately, to correct these errors, there is a very simple command to use. You may not use it every day, but it will be a great time saver.

The best way to fix typos in Terminal 

Suppose you want to change your directory to Applications folder, then the command should look like % cd Applications in your Terminal (the % is the command prompt). 



However, in a rush, you finally wrote Appplications... Your error will then be indicated, very helpfully, in the form of the following formula: cd : no such file or directory : Appplications. 

To correct it, there is fortunately a method that is very easy to perform.

Immediately after getting the error in Terminal, insert the caret ^, type the part you want to change, insert a caret again, and enter your correction.  

In our example, the three p characters were incorrect, there should only have been two. So, to fix that, we entered the command:  


^ ppp ^ pp 

macOS: how to fix typos on Terminal?

When you press the Return key, the terminal reruns the previous command with the correction you specified.


Recommended articles:

  • Mac: Permanently delete a file with the terminal
  • How do I delete backups from a Mac?
add a comment of macOS: how to fix typos on Terminal?
Comment sent successfully! We will review it in the next few hours.