Bash made better with shopt

1.Enable automatic typo correction for directory names
shopt -s cdspell
Testing

hemanth@ubuntu:/var/log$ cd /tp
/tmp
hemanth@ubuntu:/tmp$

hemanth@ubuntu:/$ cd /hom
/home
hemanth@ubuntu:/home$

hemanth@ubuntu:/home$ cd /mt
/mnt
hemanth@ubuntu:/mnt$

2.Enable ** to expand files recursively (>=bash-4.0)
shopt -s globstar
3.Avoiding history file to be overwritten
shopt -s histappend
4.Enable cd by variable names
shopt -s cdable_vars
5.Bash autocomplete case insensitive search
shopt -s nocaseglob
6.Auto cd on ~ to /home/user (>=bash-4.0)
shopt -s autocd

Share/Save

0 comments on Bash made better with shopt

    Post new comment

    The content of this field is kept private and will not be shown publicly.
    • Web page addresses and e-mail addresses turn into links automatically.
    • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
    • Lines and paragraphs break automatically.

    More information about formatting options


Drupal SEO