Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown    



CD SPELLCHECK



If, like me, you often make typos and find this annoying when typing cd commands here is the right Tip for you:

CODE
$ shopt -s cdspell

This will turn on autocorrection when you mistype the name of a directory . . . so when you type

CODE
$ cd /ect/X11

the autocorrection will read this as
 
CODE
$ cd /etc/X11


The "shopt" command will last as long as you are logged in . . . if you want it permanently you will have to add a line to your ~/.baschrc so it gets enabled at every boot.

Shopt has more nice options . . . have a look what "shopt -p" shows us:
 
QUOTE
shopt -u cdable_vars
shopt -u cdspell
shopt -u checkhash
shopt -s checkwinsize
shopt -s cmdhist
shopt -u dotglob
shopt -u execfail
shopt -s expand_aliases
shopt -u extdebug
shopt -u extglob
shopt -s extquote
shopt -u failglob
shopt -s force_fignore
shopt -u gnu_errfmt
shopt -u histreedit
shopt -u histappend
shopt -u histverify
shopt -s hostcomplete
shopt -s huponexit
shopt -s interactive_comments
shopt -u lithist
shopt -u login_shell
shopt -u mailwarn
shopt -u no_empty_cmd_completion
shopt -u nocaseglob
shopt -u nullglob
shopt -s progcomp
shopt -s promptvars
shopt -u restricted_shell
shopt -u shift_verbose
shopt -s sourcepath
shopt -u xpg_echo


If you want to know exactly what all of those options do, have a look in "man bash" in the section "Shell Bulletin Commands" under "shopt"



Bruno


-- Sep 6 2005 ( Revised Dec 13 2005 ) --


Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown