<?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; bash</title>
	<atom:link href="http://pario.no/tag/bash/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>Copy files using tar</title>
		<link>http://pario.no/2009/01/23/copy-files-using-tar/</link>
		<comments>http://pario.no/2009/01/23/copy-files-using-tar/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 15:04:34 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[tar.]]></category>

		<guid isPermaLink="false">http://pario.no/?p=906</guid>
		<description><![CDATA[This is a oneliner to copy files from current directory to another target directory using tar, preserving file attributes, dates etc. #!/bin/sh fromdir=/path/from todir=/path/to/target echo "cd $fromdir; tar cf - . &#124; (cd $todir; tar xpf -)" cd $fromdir; tar cf - . &#124; (cd $todir; tar xpf -) var wordpress_toolbar_urls = [];var wordpress_toolbar_url = [...]]]></description>
			<content:encoded><![CDATA[<p>This is a oneliner to copy files from current directory to another target directory using tar, preserving file attributes, dates etc.</p>
<pre>
#!/bin/sh

fromdir=/path/from
todir=/path/to/target

echo "cd $fromdir; tar cf - . | (cd $todir; tar xpf -)"

cd $fromdir; tar cf - . | (cd $todir; tar xpf -)
</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 = "aHR0cDovL3BhcmlvLm5vLzIwMDkvMDEvMjMvY29weS1maWxlcy11c2luZy10YXIvPHdwdGI%2BQ29weSBmaWxlcyB1c2luZyB0YXI8d3B0Yj5odHRwOi8vcGFyaW8ubm88d3B0Yj5QYXJpbyBUZWNobm9CbG9i";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2009/01/23/copy-files-using-tar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IP address change notifier script</title>
		<link>http://pario.no/2009/01/21/ip-address-change-notifier-script/</link>
		<comments>http://pario.no/2009/01/21/ip-address-change-notifier-script/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 12:57:16 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Photo etc]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[ifconfig]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://pario.no/?p=922</guid>
		<description><![CDATA[This is a simple bash script that is run by crontab every 5 minutes on a linux box. It e-mails me the new address when a change of IP address is detected. The script (ipchangemail.sh) #!/bin/bash # Check if IP-address has changed. If a change has occured, mail me the new address # Add the [...]]]></description>
			<content:encoded><![CDATA[<p>This is a simple bash script that is run by crontab every 5 minutes on a linux box.<br />
It e-mails me the new address when a change of IP address is detected.</p>
<p>The script (ipchangemail.sh)</p>
<pre>
#!/bin/bash 

# Check if IP-address has changed. If a change has occured, mail me the new address
# Add the following line to crontab if you would like it to be run every 5 minutes:
# */5 * * * * ./ipchangemail.sh

# The network interface I want to monitor
NET_INTERFACE=eth0

# File to keep the latest IP address
IP_FILE=myip.txt

# Mail to this address when a change occur
MAILTO=mail@example.com

# Read the previous IP address from file
source $IP_FILE

CURRENT_IP=`/sbin/ifconfig $NET_INTERFACE | sed -n "/inet addr:.*255.255.25[0-5].[0-9]/{s/.*inet addr://; s/ .*//; p}"`

if [ "$CURRENT_IP" != "$OLD_IP" ]
then
        # Send email about address change
        `echo "New IP address detected: $CURRENT_IP" | mail -s "New IP address" $MAILTO`

        # Write new address to file
        `echo "OLD_IP=$CURRENT_IP" > $IP_FILE`
fi
</pre>
<p>The script can be downloaded <a href="http://pario.no/wp-content/uploads/2009/01/ipchangemail.sh">here</a>.</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 = "aHR0cDovL3BhcmlvLm5vLzIwMDkvMDEvMjEvaXAtYWRkcmVzcy1jaGFuZ2Utbm90aWZpZXItc2NyaXB0Lzx3cHRiPklQIGFkZHJlc3MgY2hhbmdlIG5vdGlmaWVyIHNjcmlwdDx3cHRiPmh0dHA6Ly9wYXJpby5ubzx3cHRiPlBhcmlvIFRlY2hub0Jsb2I%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2009/01/21/ip-address-change-notifier-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rename file name suffix to uppercase or lowercase</title>
		<link>http://pario.no/2008/10/24/rename-file-name-suffix-to-uppercase-or-lowercase/</link>
		<comments>http://pario.no/2008/10/24/rename-file-name-suffix-to-uppercase-or-lowercase/#comments</comments>
		<pubDate>Fri, 24 Oct 2008 18:12:22 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[lowercase]]></category>
		<category><![CDATA[rename]]></category>
		<category><![CDATA[uppercase]]></category>

		<guid isPermaLink="false">http://pario.no/?p=781</guid>
		<description><![CDATA[This is a little oneliner to rename a files suffix from/to uppercase/lowercase. Rename a jpg suffix to JPG in the current folder # find -name "*.jpg" &#124; while read a; do mv "$a" "${a%%.jpg}.JPG" ; done The work JPG can be replaced by any other word :) var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw [...]]]></description>
			<content:encoded><![CDATA[<p>This is a little oneliner to rename a files suffix from/to uppercase/lowercase.</p>
<p>Rename a <strong>jpg</strong> suffix to <strong>JPG</strong> in the current folder</p>
<pre>
# find -name "*.jpg" | while read a; do mv "$a" "${a%%.jpg}.JPG" ; done</pre>
<p>The work JPG can be replaced by any other word :)</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 = "aHR0cDovL3BhcmlvLm5vLzIwMDgvMTAvMjQvcmVuYW1lLWZpbGUtbmFtZS1zdWZmaXgtdG8tdXBwZXJjYXNlLW9yLWxvd2VyY2FzZS88d3B0Yj5SZW5hbWUgZmlsZSBuYW1lIHN1ZmZpeCB0byB1cHBlcmNhc2Ugb3IgbG93ZXJjYXNlPHdwdGI%2BaHR0cDovL3BhcmlvLm5vPHdwdGI%2BUGFyaW8gVGVjaG5vQmxvYg%3D%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2008/10/24/rename-file-name-suffix-to-uppercase-or-lowercase/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Share a bash session using screen</title>
		<link>http://pario.no/2008/09/04/share-a-bash-session-using-screen/</link>
		<comments>http://pario.no/2008/09/04/share-a-bash-session-using-screen/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 17:35:52 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[screen]]></category>

		<guid isPermaLink="false">http://pario.no/?p=591</guid>
		<description><![CDATA[This is a short post on how you can &#8220;share&#8221; a bash session/prompt with other users. User A connects to the server and types in the command # screen User A hist the key combination &#60;Ctrl + a&#62; and the type :multiuser on User B connects to the same server as user A and can [...]]]></description>
			<content:encoded><![CDATA[<p>This is a short post on how you can &#8220;share&#8221; a bash session/prompt with other users.</p>
<ol>
<li>User A connects to the server and types in the command
<pre># screen</pre>
</li>
<li>User A hist the key combination &lt;Ctrl + a&gt; and the type
<pre>:multiuser on</pre>
</li>
<li>User B connects to the same server as user A and can the join the session by typing
<pre># screen -x</pre>
</li>
</ol>
<p>Serveral users can connect and share the same session at once.</p>
<p>To close the screen session just use the key combination &lt;Ctrl + a&gt;</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 = "aHR0cDovL3BhcmlvLm5vLzIwMDgvMDkvMDQvc2hhcmUtYS1iYXNoLXNlc3Npb24tdXNpbmctc2NyZWVuLzx3cHRiPlNoYXJlIGEgYmFzaCBzZXNzaW9uIHVzaW5nIHNjcmVlbjx3cHRiPmh0dHA6Ly9wYXJpby5ubzx3cHRiPlBhcmlvIFRlY2hub0Jsb2I%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2008/09/04/share-a-bash-session-using-screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oneliner to determine directory size</title>
		<link>http://pario.no/2008/06/23/oneliner-to-determine-directory-size/</link>
		<comments>http://pario.no/2008/06/23/oneliner-to-determine-directory-size/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 22:31:53 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[bash]]></category>

		<guid isPermaLink="false">http://pario.no/?p=466</guid>
		<description><![CDATA[This is a simple oneliner to determine which user has used most diskspace in their /home directory du -sm $(find /home -type d -maxdepth 1 -xdev) &#124; sort -g The result could look something like this ... 215 /home/userT 1367 /home/userB 10865 /home/userL 25326 /home/userY 116328 /home/userH 154426 /home/ The numbers to the left is [...]]]></description>
			<content:encoded><![CDATA[<p>This is a simple oneliner to determine which user has used most diskspace in their /home directory</p>
<pre>
du -sm $(find /home -type d -maxdepth 1 -xdev) | sort -g</pre>
<p>The result could look something like this</p>
<pre>
...
215     /home/userT
1367    /home/userB
10865   /home/userL
25326   /home/userY
116328  /home/userH
154426  /home/
</pre>
<p>The numbers to the left is size i MB.</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 = "aHR0cDovL3BhcmlvLm5vLzIwMDgvMDYvMjMvb25lbGluZXItdG8tZGV0ZXJtaW5lLWRpcmVjdG9yeS1zaXplLzx3cHRiPk9uZWxpbmVyIHRvIGRldGVybWluZSBkaXJlY3Rvcnkgc2l6ZTx3cHRiPmh0dHA6Ly9wYXJpby5ubzx3cHRiPlBhcmlvIFRlY2hub0Jsb2I%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2008/06/23/oneliner-to-determine-directory-size/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
