shopt is a builtin command which can be used to customize the way you interact with terminal is several ways. Some of them are:
shopt -s cdspell
It is possible to do this using shopt command.
shopt -s nocaseglob
shopt -s lithist
shopt -s mailwarn
shopt -s huponexit
Ignore typos in path while changing directory
Say you want to go to /home/alse/path and you type /home/alse/paht instead, the following command will intelligently take you to /home/alse/pathshopt -s cdspell
Make commands case insensitive in linux
To be frank I like case sensitiveness of commands in linux unlike in windows command prompt. It makes you more careful while writing scripts. However I know some people who would like case in-sensitiveness.It is possible to do this using shopt command.
shopt -s nocaseglob
Remove the need of 'cd' while changing directory
Tired of typing cd command before path? Try this
shopt -s autocd
Now you can simply type the path to go to that directory.
Store Multi-line commands in history
See this blog post http://lifepluslinux.blogspot.in/2014/08/storing-multi-line-commands-in-history.htmlshopt -s lithist
Mail warn
If set, and a file that Bash is checking for mail has been accessed since the last time it was checked, the message "The mail in mailfile has been read" is displayed.shopt -s mailwarn
SIGHUP by default
Bash will send SIGHUP to all jobs when an interactive login shell exits.shopt -s huponexit
No comments:
Post a Comment