grep -v with multiple patterns.


$ sed '/test/{/error|critical|warning/d}' somefile If you wanted to do all in one command, you could go w/ sed instead […] <a href=""><img …

sed tutorial and help


A very nice turorial and help <a href="">here.

change the terminal title dynamically in X11


I was actually looking for this for quite sometime. Some years back in my bashrc was the proper setting for setting the terminal title when I did a cd, and I had completely forgotten how to do it. So …

shell — one liner to selectively change case


Today I had a hard time, I had a herculian task of converting the case of file to upper case. Well that&#8217;s not difficult :), I know. What made it difficult was the fact that not the whole …

Know when you will type :q in your term instead of vi(m), the alias will chewed you out.


most simple solution is to alias :q like so: alias :q=`echo &#8221;This is not vim&#8221;` but as someone suggested in commandlinefu, you can use tput to put some color and fun into this. …

Display a block of text with delineated by a start pattern and an end pattern


Taken idea from The command will display a segment from the file from the start pattern to the end pattern. function viewsegment() { tail -n +`fgrep -n -m 1 “$1” $3 | …

View the newest xkcd comic.


This function displays the latest comic from One of the best things about xkcd is the title text when you hover over the comic, so this function also displays that after you close the comic. …

Insert a comment on command line for reminder


<a href="">Bookmark this category Insert a comment on command line for reminder […] $ ls -alh #mycomment […] Comments can be …

bash colors


For those of the terminal freaks, color is a bliss. But have you tried all the colors in the terminal. Today someone forwarded me a bash one liner for the same. Not sure where he got this from, anyway …

Linux xdg-open — replacement for start in windows


if you want to open any document with the default document handler from the bash prompt or command prompt in linux then the simplest way to do that is use &#8221;xdg-open&#8221;. This can also …

Using nullglob and dotglob in bash scripts.


<a href="">Use BASH nullglob To Verify *.c Files Exists or Not In a Directory has a nice explanation on …

On screen display of a command


<a href="">Bookmark this category delay: 2d On screen display of a command. $ date|osd_cat This is very useful if you need to show someone …

This website uses cookies to ensure you get the best experience on our website. Learn more Got it