install all solaris software from http

2011-02-23 1 min read Solaris

If you are behind a firewall and install some software like top or wget then you can not use sunfreeware, and why because ftp is blocked. Now that is not the case any more, you can go the http mirror site of sunfreeware and here is the link for the same

http://ftp.sunfreeware.com/ftp/pub/freeware/i386/5.10/

Note: you just need to change the words in bold for sparc or i386 and version of the solaris.

Continue reading

Ranking of the most frequently used commands

2011-01-31 2 min read Linux Uncategorized

Lets take a quick look at how to get the most frequently used commands on you shell. So what we need to do is this:

  <td>
    <div class="text codecolorer">
      history | awk '{print $2}' | awk 'BEGIN {FS="|"}{print $1}' | sort | uniq -c | sort -n | tail | sort -nr
    </div>
  </td>
</tr>
1

So, how did we arrive at this and will this always work? No it might not always work. A typical example is where HISTTIMEFORMAT variable is set. In that case, if you check history, you will see that after the number column we have time and date in the specified format, in which case, you will get wrong information from the above command. Anyways, forgetting these special cases, lets go to how we got this command:

Continue reading

shopt causes bash completion to stop working.

2011-01-25 1 min read Bash

Couple of days, I added some scripts to my bash startup and suddenly realized that bash completions stopped working. This is tricky situation in bash to figure out what went wrong. So, I set my foot down to make sure that I find out the culprit. Thus I started with method of elimination. So, I started with nothing in .bashrc and kept adding my stuff in batches, until the said feature was broken. Once that happened I started removing the added ones, one by one, until my completion started working again.

Continue reading

write the output of a command to /var/log/user.log… each line will contain $USER, making this easy to grep for.

2010-12-28 2 min read Bash Learning Linux

write the output of a command to /var/log/user.log… each line will contain $USER, making this easy to grep for.

  <td>
    <div class="text codecolorer">
      &nbsp;log() { (echo "$ $@";$@) | logger -t $USER; }
    </div>
  </td>
</tr>
1

This command is useful if you want to copy the output of a series of commands to a file, for example if you want to pastebin the output from ‘uname -a’, ‘lspci -vvv’ and ‘lsmod’ for video driver trouble-shooting on your favorite Linux forum.

Continue reading

Empty a file

2010-12-26 1 min read Learning Linux
Screenshot of Calculator.NET, a Free Open Sour...
  <dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">
    Image via <a href="http://commons.wikipedia.org/wiki/File:Calculator.NET_Screenshot.png">Wikipedia</a>
  </dd>
</dl>

This one is for those who know the “touch” command. Hope all of us do not follow a  command just because it is on one of the popular site without trying to understand the command and the output.

Continue reading
Older posts Newer posts