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
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:
Post a Comment