How To

How To Automatically Correct Spelling Mistakes And Typos When Using “cd” On Linux

The .bashrc file is a script that runs every time you open a Terminal window by pressing Ctrl+Alt+T or open a new tab in a Terminal window. This article will show you how to add a simple command to the .bashrc file that will check what you type into the cd command for transposed characters, missing characters, and too many characters.

You can add commands the .bashrc file that you want to run automatically every time you open a Terminal window. To add a spell check to the cd command we need to add a command to the .bashrc file. To edit the .bashrc file one must use gedit.

Type the following command at the prompt:

gedit ~/.bashrc

You can use any text editor such as vi and nano. Just replace “gedit” in the above command with the text editor you want to run.

Now scroll to the bottom of the .bashrc file and add the following line to the end of the file.

shopt -s cdspell

To Top

Pin It on Pinterest

Share This