<?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>Thu, 02 Feb 2012 13:17:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Windows grep command alternative</title>
		<link>http://pario.no/2011/09/14/windows-grep-command-alternative/</link>
		<comments>http://pario.no/2011/09/14/windows-grep-command-alternative/#comments</comments>
		<pubDate>Wed, 14 Sep 2011 12:54:29 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[findstr]]></category>
		<category><![CDATA[grep]]></category>

		<guid isPermaLink="false">http://pario.no/?p=1596</guid>
		<description><![CDATA[grep is a linux console command to print lines matching a line, but Windows does not have the grep command. In Windows you have to use the findstr command in a console window. Example C:\>dir &#124;findstr Windows 13.09.2011 10:41 Windows The findstr command is default case sensitive just like in linux. findstr options C:\>findstr -? [...]]]></description>
			<content:encoded><![CDATA[<p>grep is a linux console command to print lines matching a line, but Windows does not have the grep command.<br />
In Windows you have to use the findstr command in a console window.</p>
<p>Example</p>
<pre>
C:\>dir |findstr Windows
13.09.2011  10:41    <DIR>          Windows</pre>
<p>The findstr command is default case sensitive just like in linux.</p>
<p>findstr options</p>
<pre>
C:\>findstr -?
Searches for strings in files.

FINDSTR [/B] [/E] [/L] [/R] [/S] [/I] [/X] [/V] [/N] [/M] [/O] [/P] [/F:file]
        [/C:string] [/G:file] [/D:dir list] [/A:color attributes] [/OFF[LINE]]
        strings [[drive:][path]filename[ ...]]

  /B         Matches pattern if at the beginning of a line.
  /E         Matches pattern if at the end of a line.
  /L         Uses search strings literally.
  /R         Uses search strings as regular expressions.
  /S         Searches for matching files in the current directory and all
             subdirectories.
  /I         Specifies that the search is not to be case-sensitive.
  /X         Prints lines that match exactly.
  /V         Prints only lines that do not contain a match.
  /N         Prints the line number before each line that matches.
  /M         Prints only the filename if a file contains a match.
  /O         Prints character offset before each matching line.
  /P         Skip files with non-printable characters.
  /OFF[LINE] Do not skip files with offline attribute set.
  /A:attr    Specifies color attribute with two hex digits. See "color /?"
  /F:file    Reads file list from the specified file(/ stands for console).
  /C:string  Uses specified string as a literal search string.
  /G:file    Gets search strings from the specified file(/ stands for console).
  /D:dir     Search a semicolon delimited list of directories
  strings    Text to be searched for.
  [drive:][path]filename
             Specifies a file or files to search.

Use spaces to separate multiple search strings unless the argument is prefixed
with /C.  For example, 'FINDSTR "hello there" x.y' searches for "hello" or
"there" in file x.y.  'FINDSTR /C:"hello there" x.y' searches for
"hello there" in file x.y.

Regular expression quick reference:
  .        Wildcard: any character
  *        Repeat: zero or more occurrences of previous character or class
  ^        Line position: beginning of line
  $        Line position: end of line
  [class]  Character class: any one character in set
  [^class] Inverse class: any one character not in set
  [x-y]    Range: any characters within the specified range
  \x       Escape: literal use of metacharacter x
  \<xyz    Word position: beginning of word
  xyz\>    Word position: end of word

For full information on FINDSTR regular expressions refer to the online Command
Reference.</pre>
<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 = "aHR0cDovL3BhcmlvLm5vLzIwMTEvMDkvMTQvd2luZG93cy1ncmVwLWNvbW1hbmQtYWx0ZXJuYXRpdmUvPHdwdGI%2BV2luZG93cyBncmVwIGNvbW1hbmQgYWx0ZXJuYXRpdmU8d3B0Yj5odHRwOi8vcGFyaW8ubm88d3B0Yj5QYXJpbyBUZWNobm9CbG9i";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2011/09/14/windows-grep-command-alternative/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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.]]></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>
	</channel>
</rss>

