Backup of files in the directory.

2011-12-01 2 min read Bash Learning Linux

I was working on some scripts and the changes that I was making in the scripts was very dynamic, which I did want to keep backing up in the version control system. But for the peace of my mind, I wanted to keep a copy of the scripts, whenever it was in working state.

Since I had multiple files, so it would make more sense to have a script that could copy all the files in the current directory to “old” directory without over-writing the existing files. So, I wrote a script that would postfix the files with a number. With this approach, finally what I had was the following:

Continue reading

Compare files excluding certain lines.

2011-10-18 1 min read Bash Fedora Learning Linux

Quick tip, you can use any expression for the sed commands in the (). With this trick you can redirect the stdout of 2 commands to the diff command. This might become very useful, if you want to compare 2 files, excluding the first  line.

diff <(sed '1d' file) <(sed '1d' file2)

More interesting example is where the string ABC is converted to abc before comparing in the second file with the following command:

Continue reading

Get yourself some conkyrc files.

2011-10-05 2 min read Fedora Linux

If you are looking for some nice conkyrc files, then you can head over to :

Ubuntu Forums

In this thread you can see some very nice conkyrc files with screenshots. You can browse through the thread and get the one that you like. But if you are like me and would like to download all of them to see the features and commands in each of them then you would need to copy each of these files and paste them separately. But if you have to do everything manually then there’s not much of being on Linux 🙂

Continue reading

some interesting alias

2011-09-27 1 min read Linux

For this time, I will just give you a link to to bashrc file.

http://hayne.net/MacDev/Bash/aliases.bash

Head over there and see some very interesting aliase’s.

Enhanced by Zemanta

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

Take a screenshot of the window the user clicks on and name the file the same as the window title

2010-12-19 2 min read Bash Learning Photo

Take a screenshot of the window the user clicks on and name the file the same as the window title

  <td>
    <div class="text codecolorer">
      &nbsp;sleep 4; xwd >foo.xwd; mv foo.xwd "$(dd skip=100 if=foo.xwd bs=1 count=256 2>/dev/null | egrep -ao '^[[:print:]]+' | tr / :).xwd"
    </div>
  </td>
</tr>
1

In general, this is actually not better than the “scrot -d4” command I’m listing it as an alternative to, so please don’t vote it down for that. I’m adding this command because xwd (X window dumper) comes with X11, so it is already installed on your machine, whereas scrot probably is not. I’ve found xwd handy on boxen that I don’t want to (or am not allowed to) install packages on.

Continue reading

New feature in Gnome/Nautilus

2010-12-05 1 min read Fedora GNOME

One of the things that I never realized that I am missing in Nautilus until they put the feature in was this. When a file is being copied and there is conflict, there should be option to rename the new file being copied. Also, if the file being copied is image then a small preview/thumbnail would be good.

Yesterday while copying some files, suddenly I noticed that this feature is there now. Pretty useful feature to have. Here’s the screen-shot.

Continue reading
Older posts Newer posts