<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pario TechnoBlob &#187; grep</title>
	<atom:link href="http://pario.no/tag/grep/feed/" rel="self" type="application/rss+xml" />
	<link>http://pario.no</link>
	<description>A cronological documentation test project, nothing serious, really!</description>
	<lastBuildDate>Wed, 14 Jul 2010 12:12:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>My 10 most used linux commands</title>
		<link>http://pario.no/2008/02/25/my-10-most-used-linux-commands/</link>
		<comments>http://pario.no/2008/02/25/my-10-most-used-linux-commands/#comments</comments>
		<pubDate>Mon, 25 Feb 2008 07:49:40 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[count]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[head]]></category>
		<category><![CDATA[nl]]></category>
		<category><![CDATA[sort]]></category>

		<guid isPermaLink="false">http://pario.no/2008/02/25/my-10-most-used-linux-commands/</guid>
		<description><![CDATA[This is a oneliner bash command to determine my 10 most used linux commands according to my history file history &#124; awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' &#124; grep -v "./" &#124; column -c3 -s " " -t &#124; sort -nr &#124; nl &#124; head -n10 The [...]]]></description>
			<content:encoded><![CDATA[<p>This is a oneliner bash command to determine my 10 most used linux commands according to my history file</p>
<pre>history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl |  head -n10</pre>
<p>The result</p>
<pre>
     1  188  37.6%  vi
     2  38   7.6%   ls
     3  24   4.8%   cat
     4  22   4.4%   apt-get
     5  12   2.4%   date
     6  11   2.2%   tail
     7  11   2.2%   cd
     8  10   2%     rm
     9  10   2%     man
    10  9    1.8%   basename</pre>
<p>It looks like i use <strong>vim</strong> a lot on my home server. You should try it yourself and see what commands you use the most.</p>
<p>Source: <a href="http://linux.byexamples.com/archives/332/what-is-your-10-common-linux-commands/">http://linux.byexamples.com</a></p>
<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/linux.byexamples.com\/archives\/332\/what-is-your-10-common-linux-commands\/"];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDgvMDIvMjUvbXktMTAtbW9zdC11c2VkLWxpbnV4LWNvbW1hbmRzLzx3cHRiPk15IDEwIG1vc3QgdXNlZCBsaW51eCBjb21tYW5kczx3cHRiPmh0dHA6Ly9wYXJpby5ubzx3cHRiPlBhcmlvIFRlY2hub0Jsb2I%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2008/02/25/my-10-most-used-linux-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache web connections pr hour</title>
		<link>http://pario.no/2008/02/21/apache-web-connections-pr-hour/</link>
		<comments>http://pario.no/2008/02/21/apache-web-connections-pr-hour/#comments</comments>
		<pubDate>Thu, 21 Feb 2008 22:26:15 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://pario.no/2008/02/21/428/</guid>
		<description><![CDATA[This is a bash oneliner to show Apache web connections pr hour. It lists up the IPs that has accessed your webserver and the amount og accesses. # cat /var/log/apache2/access_log_pario.no &#124; grep "21/Jan/2008:.." &#124; awk {' print $4":"$1 '} &#124; sed 's/\[//g' &#124; awk -F : {' print $1":"$2"\t\t"$5 '} &#124; sort &#124; uniq -c [...]]]></description>
			<content:encoded><![CDATA[<p>This is a bash oneliner to show Apache web connections pr hour. It lists up the IPs that has accessed your webserver and the amount og accesses.</p>
<pre>
# cat /var/log/apache2/access_log_pario.no | grep "21/Jan/2008:.." | awk {' print $4":"$1 '} | sed 's/\[//g' | awk -F : {' print $1":"$2"\t\t"$5 '} | sort | uniq -c</pre>
<p>Example output</p>
<pre>
37 21/Jan/2008:00          192.168.0.10</pre>
<p>This shows that I had 37 hits from 00:00 &#8211; 01:00 in 20th February 2008.</p>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDgvMDIvMjEvYXBhY2hlLXdlYi1jb25uZWN0aW9ucy1wci1ob3VyLzx3cHRiPkFwYWNoZSB3ZWIgY29ubmVjdGlvbnMgcHIgaG91cjx3cHRiPmh0dHA6Ly9wYXJpby5ubzx3cHRiPlBhcmlvIFRlY2hub0Jsb2I%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2008/02/21/apache-web-connections-pr-hour/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strip the kernel to contain only needed modules</title>
		<link>http://pario.no/2007/12/04/strip-the-kernel-to-contain-only-needed-modules/</link>
		<comments>http://pario.no/2007/12/04/strip-the-kernel-to-contain-only-needed-modules/#comments</comments>
		<pubDate>Tue, 04 Dec 2007 14:38:45 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cut]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[lsmod]]></category>
		<category><![CDATA[modinfo]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[xargs]]></category>

		<guid isPermaLink="false">http://pario.no/2007/12/04/strip-the-kernel-to-contain-only-needed-modules/</guid>
		<description><![CDATA[This is a great page with som nice bash scripts describing how to remove unwanted modules from your kernel. var wordpress_toolbar_urls = ["http:\/\/wiki.linuxquestions.org\/wiki\/Configuring_linux_kernel"];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDcvMTIvMDQvc3RyaXAtdGhlLWtlcm5lbC10by1jb250YWluLW9ubHktbmVlZGVkLW1vZHVsZXMvPHdwdGI%2BU3RyaXAgdGhlIGtlcm5lbCB0byBjb250YWluIG9ubHkgbmVlZGVkIG1vZHVsZXM8d3B0Yj5odHRwOi8vcGFyaW8ubm88d3B0Yj5QYXJpbyBUZWNobm9CbG9i";]]></description>
			<content:encoded><![CDATA[<p>This is a great page with som nice bash scripts describing <a href="http://wiki.linuxquestions.org/wiki/Configuring_linux_kernel">how to remove unwanted modules from your kernel</a>.</p>
<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/wiki.linuxquestions.org\/wiki\/Configuring_linux_kernel"];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDcvMTIvMDQvc3RyaXAtdGhlLWtlcm5lbC10by1jb250YWluLW9ubHktbmVlZGVkLW1vZHVsZXMvPHdwdGI%2BU3RyaXAgdGhlIGtlcm5lbCB0byBjb250YWluIG9ubHkgbmVlZGVkIG1vZHVsZXM8d3B0Yj5odHRwOi8vcGFyaW8ubm88d3B0Yj5QYXJpbyBUZWNobm9CbG9i";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2007/12/04/strip-the-kernel-to-contain-only-needed-modules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backup mysql databases into separate files</title>
		<link>http://pario.no/2007/11/18/backup-mysql-databases-into-separate-files/</link>
		<comments>http://pario.no/2007/11/18/backup-mysql-databases-into-separate-files/#comments</comments>
		<pubDate>Sun, 18 Nov 2007 21:07:39 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysqldump]]></category>

		<guid isPermaLink="false">http://pario.no/2007/11/18/backup-mysql-databases-into-separate-files/</guid>
		<description><![CDATA[This bach script makes separate backup files of all the databases in mysql and saves the result in the mysql_backup folder. #!/bin/bash -v USERNAME='yourusername' PASSWORD='yourpassword' HOSTNAME='yourhostname' BackupFolder='/backup' for i in $(echo 'SHOW DATABASES;' &#124; mysql --user $USERNAME -p$PASSWORD -h $HOSTNAME &#124; grep -v '^Database$' ); do mysqldump --user $USERNAME -p$PASSWORD -h $HOSTNAME --opt $i > [...]]]></description>
			<content:encoded><![CDATA[<p>This bach script makes separate backup files of all the databases in mysql and saves the result in the mysql_backup folder.</p>
<pre>#!/bin/bash -v

USERNAME='yourusername'
PASSWORD='yourpassword'
HOSTNAME='yourhostname'
BackupFolder='/backup'

for i in $(echo 'SHOW DATABASES;' | mysql --user $USERNAME -p$PASSWORD -h $HOSTNAME | grep -v '^Database$' ); do
        mysqldump --user $USERNAME -p$PASSWORD -h $HOSTNAME --opt $i > $BackupFolder/$i.sql;
done;</pre>
<p>Remember to change the -h, -p and -h switch according to your needs and avoid space between -p and the password variable.</p>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDcvMTEvMTgvYmFja3VwLW15c3FsLWRhdGFiYXNlcy1pbnRvLXNlcGFyYXRlLWZpbGVzLzx3cHRiPkJhY2t1cCBteXNxbCBkYXRhYmFzZXMgaW50byBzZXBhcmF0ZSBmaWxlczx3cHRiPmh0dHA6Ly9wYXJpby5ubzx3cHRiPlBhcmlvIFRlY2hub0Jsb2I%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2007/11/18/backup-mysql-databases-into-separate-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grep recursively through subdirectories</title>
		<link>http://pario.no/2007/11/01/grep-recursively-through-subdirectories/</link>
		<comments>http://pario.no/2007/11/01/grep-recursively-through-subdirectories/#comments</comments>
		<pubDate>Thu, 01 Nov 2007 13:54:16 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[regex]]></category>

		<guid isPermaLink="false">http://pario.no/2007/11/01/grep-recursively-through-subdirectories/</guid>
		<description><![CDATA[grep recursively through subdirectories for files that match a specific pattern: grep -l -r –include=*.doc regex * The equivalent command unsing find: find . -name ‘*.doc’ -exec grep -l regex \{\} \; The option after grep is the lowercase letter L, not the number 1). Remove the -l to see the actual matches instead of [...]]]></description>
			<content:encoded><![CDATA[<p>grep recursively through subdirectories for files that match a specific pattern:</p>
<pre>
grep -l -r –include=*.doc regex *</pre>
</p>
<p>The equivalent command unsing find:</p>
<pre>
find . -name ‘*.doc’ -exec grep -l regex \{\} \;</pre>
</p>
<p>The option after grep is the lowercase letter L, not the number 1).<br />
Remove the -l to see the actual matches instead of the file names.</p>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDcvMTEvMDEvZ3JlcC1yZWN1cnNpdmVseS10aHJvdWdoLXN1YmRpcmVjdG9yaWVzLzx3cHRiPkdyZXAgcmVjdXJzaXZlbHkgdGhyb3VnaCBzdWJkaXJlY3Rvcmllczx3cHRiPmh0dHA6Ly9wYXJpby5ubzx3cHRiPlBhcmlvIFRlY2hub0Jsb2I%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2007/11/01/grep-recursively-through-subdirectories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
