concatenate compressed and uncompressed logs

2010-06-21 1 min read Bash Linux

<span style="font-size: x-large;"><a href="http://feedproxy.google.com/~r/Command-line-fu/~3/iwFUyltYgjM/concatenate-compressed-and-uncompressed-logs">concatenate compressed and uncompressed logs

$ find /var/log/apache2 -name 'access.loggz' -exec <a class="zem_slink freebase/en/gzip" title="Gzip" rel="homepage" href="http://www.gzip.org/">zcat {} ; -or -name 'access.log' -exec cat {} ; This command allows you to stream your log files, including gziped files, into one stream which can be piped to <a class="zem_slink freebase/en/awk" title="AWK" rel="homepage" href="http://cm.bell-labs.com/cm/cs/awkbook/index.html">awk or some other command for analysis.

Note: if your version of &#8217;find&#8217; supports it, use:

Continue reading

Linux command to repeat a string n times

2010-06-17 1 min read Bash

There are more than one situation where you wished that there was a simple way to print a character n number of times. At least I face that quite often, especially when you want to print a menu. I found this post today which has pretty good solution and also the way how it works :
<a href="http://superuser.com/questions/86340/linux-command-to-repeat-a-string-n-times">http://superuser.com/questions/86340/linux-command-to-repeat-a-string-n-times

\"Enhanced

17 Cool firefox tweaks.

2010-06-16 1 min read Fedora Firefox Linux

A very nice article on firefox can be found here. Though written for Ubuntu should be applicable to all distro&#8217;s.

<a href="http://www.ubuntu-inside.me/2009/07/17-cool-firefox-aboutconfig-tricks.html">http://www.ubuntu-inside.me/2009/07/17-cool-firefox-aboutconfig-tricks.html

Most of it was done in my machine even before I read the article but good to see all of them together 🙂

GCompris — Kids games and learning activities and hacks.

2010-06-15 2 min read Linux

I found a nice game and learning software for Kids yesterday. It is called <a href="http://gcompris.net/" target="_blank">GCompris. Details of the software as in their website is<div class="contenu">

GCompris is an educational software suite comprising of numerous activities for children aged 2 to 10. Some of the activities are game orientated, but nonetheless still educational. Below you can find a list of categories with some of the activities available in that category.

Continue reading

IRC on Linux de-mystified for new users only

2010-06-15 2 min read Linux

The other day, I was trying to fix something in my firefox and found that the way to go was to login to IRC and go to the mozilla <a class="zem_slink freebase/en/server" title="Server (computing)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Server_%28computing%29">server and join #firefox.

Though IRC is quite native to <a class="zem_slink freebase/en/linux" title="Linux" rel="wikipedia" href="http://en.wikipedia.org/wiki/Linux">Linux, I did not know where to start. So, I noted down the list of steps that need to be done to get you started. (Note this may not be new to most of you).

Continue reading

Default files and settings for new users on most Linux distribution – Linux Ubuntu

2010-06-09 1 min read Linux

For most common distributions of Linux the default settings for the newly created user with GUI or useradd command is taken from the directory /etc/skel

All the files (including the hidden files) are copied to the newly created users home directory. This can be used to modify the defaul .bashrc .vimrc and other such files in the users home directory. You can copy the files in &#8221;/etc/skel&#8221; the files that you want to keep in the users home directory. This can contain soft links or hard links also (Be careful to link to the full path in this directory).

Continue reading

Verify all the paths in the PATH directory

2010-06-08 1 min read Bash Learning Linux

Here is the command to test that all the directories in your path actually exist.

(<a class="zem_slink freebase/en/internal_field_separator" title="Internal field separator" rel="wikipedia" href="http://en.wikipedia.org/wiki/Internal_field_separator">IFS=:;for p in $PATH; do test -d $p || echo $p; done)

And the explanation :

Set the IFS to &#8221;:&#8221;

now we loop through the PATH variable

and test all the directories with &#8221;test -d&#8221;

Here is another version without IFS:

for i in ${PATH//:/ };do test  -d $i || echo $i;done

Continue reading
Older posts Newer posts