bash mathematical calculators.

2011-01-25 3 min read Bash Fedora Learning Linux

To start with , the most simple and easy to use should be “bc”. but just for some guys who want to be more experimental, here are few more bash calulator programs. These are completely command line and thus you can completely integrate them in your shell script or use them in shell script to do some really crazy maths calculations.

  <td>
    <div class="text codecolorer">
      sudo yum install calc clac
    </div>
  </td>
</tr>
1

Lets start with installing these. Before we start, don’t blame and flame me if your favourite is not there in the list. If it is not, better is you drop me  a comment or email, and I will see, if I can include it in the list above, but remember this is only for console based calculators.

Continue reading

Find all the missing paths in the PATH variable in bash script

2011-01-20 1 min read Bash Fedora Learning

Here is a simple script that will list out all the paths in the PATH variable that do not exist.

  <td>
    <div class="text codecolorer">
      #!/bin/bash -<br /> #===============================================================================<br /> #<br /> #          FILE:  wrong_path.sh<br /> #<br /> #         USAGE:  ./wrong_path.sh<br /> #<br /> #   DESCRIPTION:  Show Directories in the PATH Which does NOT Exist<br /> #<br /> #       OPTIONS:  ---<br /> #  REQUIREMENTS:  ---<br /> #          BUGS:  ---<br /> #         NOTES:  ---<br /> #        AUTHOR:  Amit Agarwal (AKA), amit.agarwal@amit-agarwal.co.in<br /> #       COMPANY:  Individual<br /> #       VERSION:  1.0<br /> #       CREATED:  09/20/2009 09:15:48 AM IST<br /> #      REVISION:  ---<br /> #===============================================================================<br /> <br /> set -o nounset                              # Treat unset variables as an error<br /> <br /> (IFS=:;for p in $PATH; do test -d $p || echo $p; done)
    </div>
  </td>
</tr>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

New feature in Nautilus – resize icon on desktop.

2011-01-10 1 min read GNOME Learning

On Desktop on Gnome using nautilus, now you can resize individual icons. Just right click on the icon to resize and in the menu you will get a resize icon :

[Resize icon][1]
Resize icon

and then you can resize the icon from the borders:

[Resize icon][2]
Resize icon
Enhanced by Zemanta

Execute a command with a timeout

2010-12-29 1 min read Bash Learning
Official Ubuntu circle with wordmark. Replace ...
  <dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">
    Image via <a href="http://commons.wikipedia.org/wiki/File:Ubuntu_logo.svg">Wikipedia</a>
  </dd>
</dl>

Execute a command with a timeout

  <td>
    <div class="text codecolorer">
      &nbsp;timelimit -t100 somecommand
    </div>
  </td>
</tr>
1

I found this in Ubuntu repos, and consider it better than timeout.

* View this command to comment, vote or add to favourites * View all commands by CodSpirit

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