“shopt -s cdspell” : Automatically correct mistyped directory names on cd

Use shopt -s cdspell to correct the typos in the cd command automatically as
shown below.

$ cd /var/vmall
-bash: cd: /var/vmall: No such file or directory
$ shopt -s cdspell
$ cd /var/vmall
$ pwd
/var/vmail

Here actually i mistyped 'vmail' as 'vmall'.

Enjoy!

Leave a comment

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

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.