bashrc with lots of functions and useful alias

Here is a link of a useful 10K lines bashrc

You may not want to put the whole thing, but get an idea and use what you think can be helpful to you or at-least get an idea. This was not posted by me, so if you are re-using code as is, check the permissions to copy.

Ignore CVS and svn directories in bash autocompletion.

CVS and SVN directories are something that really cause lot of un-necessary nuisance. So, simple solution just ignore them 🙂

export FIGNORE=CVS:~:.o:.svn
bind 'set match-hidden-files off'
Enhanced by Zemanta

Filename completion in Linux with mixed case and ignored case.

This is one of my favourites, alwahs keep it handy. Linux is case sensitive by nature but you will always find filenames jumbled up in the case. So what is the solution:

bind \”set completion-ignore-case on\”

Just execute the above in your bash command and file/dir name will behave like Windows. Remember that this is per session setting and thus the names do not get changed internally, it only changes the way to access it (specifically completion only). So if you want this behaviour in all your sessions put this in the appropriate profile file.

Another place where you can put this is \”.inputrc\”, where it will go like the below:

set completion-ignore-case on

If this one is not working then try putting the below in your profile and reinvoke your bash, it should work.

export INPUTRC=~/.inputrc

And if you have re-defined the HOME variable then you can give the complete path of the inputrc file.