Archive for the ‘GNU/Linux’ Category
Finding number of lines in files recursively
I wanted to find the number of lines from a set of files – spread out in nested directories. The shell command “wc” is best for finding number of words / lines in files but it does not have an argument for recursive searching.
Here’s a quick shell command sequence that will find you the line count from all files in a directory – recursively.
find /topleveldirectory/ -type f -exec wc -l {} \; | awk '{total += $1} END{print total}'
Replace “/topleveldirectory/” with your directory of choice. Leave it as “.” to find from current directory and below.
Found on Unix.com
Introduction to Screencasting in Linux – recordMyDesktop
Screencasting is a great way to share information. I use it to show bugs to my team, to record training videos of the project management system I am working on, and even to record demos of project deliveries to clients. I use Jing to record videos from my Mac. But wanted to find something useful for Linux.
recordMyDesktop is a great Linux tool to record the entire desktop, a portion or an application. It outputs Ogg format video, which can easily be converted to AVI, QuickTime or FLV. It’s been there for a while, and is pretty solid.
What sold me though, was this video explaining how to use recordMyDesktop – and then to convert saved video into other formats. It’s easy to follow and covers all important aspects.
If you want to record screens from Linux, this is the best tool. Try it out!
(thanks Santosh for pointing me to this!)
Congratulations Kartik!

Congratulations Kartik for becoming a Debian Developer! You make me proud! It’s been a long journey. You have stayed on course despite all the odds. Congratulations!
Thanks for the graphic Kunal
Grab more contacts – ContactGrabber does 10 sites now
Attention: Contact Grabber is not actively maintained anymore. We recommend OpenInviter instead. OpenInviter supports more sites and is in active development.
The latest version of our GPL product ContactGrabber now allows you to fetch contacts from 10 different sites.
- AOL (new)
- LinkedIn (new)
- Lycos (new)
- IndiaTimes (new)
- Yahoo
- Orkut
- Gmail
- Rediff
- Hotmail
- Myspace
ContactGrabber allows you to retrieve the address book contact information from various sites. If you are developing a site and need your users to import their contacts from other sites, or recommend you to their contacts, this is a great solution!
ContactGrabber is developed in PHP and is released under GPL.
Note: As of now, Gmail has an issue with some email accounts. They are moving accounts from one server to another and that’s what is causing the problem. This should be corrected soon.
Download ContactGrabber from: https://sourceforge.net/projects/contactgrabber
The code has been contributed by Magnet’s Mumbai and Ahmedabad teams! Great work guys!
Search and Replace Recursively using sed and grep
I have done this so many times, still I find a new problem doing recursive search and replace each time! Here's one small shell script that puts the issues I had on the Mac doing search and replace on a directory recursively.
Save the file as rpl.sh, chmod it 755, and execute it like:
-
./rpl.sh folderContainingFiles/ oldText newText
Does the job for me! This could be done in a single line, I got some ideas of using xargs etc, but all that did not work on my Mac (at least). So resorting to this.
-
#!/bin/sh
-
grep -rl $2 $1 |
-
while read filename
-
do
-
(
-
echo $filename
-
sed "s/$2/$3/g;" $filename> $filename.xx
-
mv $filename.xx $filename
-
)
-
done
And yes, if you are going to use this, take a little time and do some argument checking before passing them around! Unless you think only a God user like you is going to use it!

