bash

Splitting strings with IFS

2010/02/04

Today I want to discuss splitting strings into tokens or “words”. I previously discussed how to do this with the <a …

Color output from ls – based on file type

2010/02/04

Threre are certain default variables which control the color of the output from the ls command, so we will talk about them today. The first one is to get the color output from the …

Bash styling(themeing), the stylist way.

2010/02/04

For last couple of days, I have been looking for solutions to make stlying my bash easier. So, first a screenshot of the effort: <img class="size-full wp-image-703" title="bash …

grep -v with multiple patterns.

2010/01/25

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

Seders\’s grab bag – Tutorials

2010/01/24

<a href="http://sed.sourceforge.net/grabbag/tutorials/">http://sed.sourceforge.net/grabbag/tutorials/ […] <a …

change the terminal title dynamically in X11

2010/01/09

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

2010/01/07

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 …

Display the output of a command from the first line until the first instance of a regular expression.

2010/01/04

| perl -n -e 'print "$_" if 1 … /«a class="zem_slink freebase/en/regular_expression" title="Regular expression" rel="wikipedia" …

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

2009/12/20

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

2009/12/18

Taken idea from commandlinefu.com 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.

2009/12/07

This function displays the latest comic from xkcd.com. 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

2009/12/05

<a href="http://blog.amit-agarwal.co.in/category/linux/">Bookmark this category Insert a comment on command line for reminder […] $ ls -alh #mycomment […] Comments can be …


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