Bash tip: Autocorrect typos with shopt
Typing on the command line isn’t easy. First, it takes a lot of time to learn how all the commands work, but then even after that you need to be very precise with your file and directory names, otherwise you’ll need to try and try again.
But there’s a way out: Bash has a built-in command called “shopt” that lets you set various command-line options. For example, running shopt -s cdspell enables automatic typo correction for directory names, so that typing cd /hom/hudzila will get you to the nearest match – /home/hudzilla.
You can also use shopt -s nocaseglob so that when you type part of a filename and press Tab to autocomplete, Bash does a case-insensitive search.







