Skip to main content
Welcome guest. | Register | Login | Post


Use HISTIGNORE in bash

Don't you find it annoying when you have been using the same command in bash a few times in a row, and then you scroll through the history to a previous command only having to go through many duplicates of the command you just used.

For this use bash's HISTIGNORE variable, set in in your ~/.bashrc file.

Will mean you will not have duplicates in your bash history, but you can use other varables too, say you don't want the commands beggining with c to be put in the history.

An example of this together with not having duplicates:

Tried Ogle? Try it if you didn't and are looking for a simple and rather painless ways to play your DVD's on your PC almost as if you plugged them in a standalone DVD player (for a TV set) without having to do alot of tweaking just to get it playing right and without anomalies and with subtitles working (if you need them).

Ogle supports DVD menu and seems to tune in to any DVD without a problem.

I have added it to my ~/.xinitrc file (by default commented) like this:

#gksudo ogle /dev/hdd

So when I want to play a DVD I just insert it in my DVD player, go out of GNOME (or whatever I may be using in X) to console (killing X in the process of course), modify my ~/.xinitrc file to comment out the mentioned command and comment the one that usually starts GNOME (exec gnome-session) and then just startx to start playing a DVD.

Simple Text Editor

You can use the cat command as a simple text editor for creating or appending files.

If you want to write a small file just:

cat > file << "EOF"
> put
> your
> text
> here

and then you'll have written your file with the text you put in.

Speedup Gentoo's Boot

If you start many services at boot, edit your /etc/conf.d/rc so that you have a line reading RC_PARALLEL_STARTUP="yes"
This will start up some services in paralel to save time at bootup.

Searching bash history

Do you only half-remember a commandline command you recently used? If you use bash (most likely you do), you don't need to look it up again or reinvent it. Just type control-r and then the part you do remember. Bash will search it's history for commands of which what you typed is a substring.

Example: I remember I used some browser to visit some site named (something)fied(something):

ctrl-r fied

and the result is:

(reverse-i-search)`fied': firefox

Now just press enter to visit everyone's favourite free software help site :-)

You can find some more tips in an old tips thread.