There is an option you can set so that when using the cd
command, small typos are automatically corrected. Add the following to your ~/.bashrc
:
# cd: autocorrect small typos and use best guess
shopt -s cdspell
Example:
cd Porjects
# Projects
pwd
# /home/judith/Projects
Also, I recommend adding aliases for your most common typos of commands you regularly use to your ~/bashrc
. Which ones that are is highly personal, for me it's e.g. tig:
alias tog='tig'
alias tug='tig'
Posted by Judith Roth to makandra dev (2021-09-17 17:09)