Oh, and a hint for everyone who is still greping through the bash history to find the command he used … well, way back. Try Ctrl+R
Yeah, hit Ctrl+R when on the console and enter the first few characters of the command line you search in the history. Now let’s say you had multiple entries to cp a file somewhere, then simply use Ctrl+R again to “go back” within the search matches.
BTW: If you ever mistakenly entered a sensitive password on the command line, use export HISTSIZE=0, log out and log back in, the history will be gone. Of course this erases the whole bash history, so better don’t enter the password on the command line in the first place
Oh, and another one. Are you still logging off just to apply the settings of a changed .bashrc or .bash_aliases? Forget about it, use . ~/.bashrc or (which is the same) source ~/.bashrc, to apply the variables to your currently running shell session. I expect my readers to be intelligent enough to vary the scheme and apply it to .bash_aliases and, well, other files
// Oliver
Yes, indeed bash has become my favorite shell. Not only is it so versatile, but some of those advanced features make it best-suited for almost any task you’ll ever face on a console. And if it is not enough for a particular task, a simple perl -e or a few of those typical POSIX utilities such as find, awk, tr, cut, cat, grep, tar, bzip2, gzip and so on in a row piping output from one to the other will do wonders.
Besides, with the subshells that you can create on demand using backticks or, for example $(commands) are wonderful when used in conjunction with SSH to pipe input from/to a remote SSH session. Yes, scrap SCP and SFTP, SSH can do without them. In fact I built a little (bash) script at FRISK, which can be used to deploy certain files to all target systems and then even execute commands there. SSH-authentication via private/public key can be so useful if you have a distributed build-system
Anyway, recently I already showed what nice things you can do with Bash, by “hooking” a script that you wouldn’t otherwise want to modify. Now it’s time to reveal how my .bashrc looks. Note, that I use the same .bashrc for my own account and for the super user, so some code is simply never called when running as a normal user. I hope this will help others to create their own customized version of .bashrc …
Download my .bashrc here
// Oliver