Sunday, 4 May 2014

How to automatically correct mistyped directory names on cd ?

How to automatically correct mistyped directory names on cd ?

Ans-
Use shopt -s cdspell to correct the typos in the cd command automatically as shown below.
# cd /tmp/dar1
-bash: cd: f: No such file or directory
#  shopt -s cdspell

# cd /tmp/dar1
#pwd 
/tmp/dir1
Note: By mistake, when I typed dar instead of dir ,cd correct it automaticaly.

No comments:

Prasanta Kumar Behera. Mob- 8147470101