wow that is useful, thanks!
Hmm, I read this sweet little trick on a forum somewhere. I'll find out where it was and give credit where credit is due.
Anyways, here's a nice enhancement for your Xterm-based terminal:
Oddly enough, few people has heard about the command called shopt. Shop can be used to set/unset options specific for you terminal. For instance, typing 'shopt -s' in the terminal produces a list of options turned on. In my case, this is:
$ shopt -s
checkwinsize on
cmdhist on
expand_aliases on
hostcomplete on
interactive_comments on
progcomp on
promptvars on
sourcepath on
shopt -u shows a list of options that are not currently on.
Now, if you try shopt -s checkwinsize, you'll get that annoying wordwrapping fixed.
Trying shopt -s cdspell enables a cool little 'spellchecker'. Example:
$ shopt -s cdspell
$ cd /sur/scr
/usr/src
Sweet, no?
Hope this helps anyone. shopt is pretty nice, even though it's just a minor thing. Try placing these commands in /etc/profile to have them enabled at all times.
wow that is useful, thanks!
Wow, I didn't even know that was there. Thanks post. The spell check is sweet.
Very cool. I'm going to put that in the tips 'n tricks section on my site
I prefer the way tcsh does the spell-checking though (it prompts whether you want the change, do not want the change, want to edit the command or totally abort - dunno exactly how this is configured, in the gentoo default configuration).
Thanks a lot
Sam
Hah, nice to see that people likes it.
I'll post more small stuff like that as soon as I find more.
I love checking out those hidden things.
Most of the people is also not aware that there is such a thing as
which can be found under debian in /etc/bash_completion (I'm not sure if other distros ship it with bash as well but it is available online)Code:# bash_completion - some programmable completion functions for bash
And this thing is not enabled by default:
But if you enable it you get smart bash complition. So whenever you typeCode:*ravana[0] ~>grep complet /etc/bash.bashrc # enable bash completion in interactive shells #if [ "$PS1" -a -f /etc/bash_completion ]; then # . /etc/bash_completion
acroread fn and press tab, it will complete not to all files in the directory but rather to the files with extension pdf! The same idea goes behind many other known tools (mplayer etc). But what is more fun: under debian do
apt-get install moz
and press tab -- you will get completions for the names of the available packages named by moz<somthing>
So use and enjoy :-)
o - and if you need non-standart name of the file with a "wrong" extension, just use Alt-/ :-)
Bookmarks