<?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>Stefan Sobek Blog &#187; Linux</title>
	<atom:link href="http://www.sobek.info/blog/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sobek.info/blog</link>
	<description>Writing about IT, Software Engineering, sports and other stuff</description>
	<lastBuildDate>Mon, 24 Jan 2011 12:50:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>OCR under linux</title>
		<link>http://www.sobek.info/blog/2010/02/08/ocr-under-linux/</link>
		<comments>http://www.sobek.info/blog/2010/02/08/ocr-under-linux/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 09:04:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[ocr]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[tif]]></category>

		<guid isPermaLink="false">http://www.sobek.info/blog/?p=60</guid>
		<description><![CDATA[Imagine you have a pdf-file you want to make ocr-recognition. Take a scenario where you want to automatically let your linux pc do the job, e.g. in a folder. 
I choose tesseract-ocr as ocr-programm. Easy to install and use and ok for my use. Unfortunately it takes only tif as input file type so that [...]]]></description>
			<content:encoded><![CDATA[<p>Imagine you have a pdf-file you want to make ocr-recognition. Take a scenario where you want to automatically let your linux pc do the job, e.g. in a folder. </p>
<p>I choose tesseract-ocr as ocr-programm. Easy to install and use and ok for my use. Unfortunately it takes only tif as input file type so that we have to convert the pdf to tif first.</p>
<p><strong>To create a tif file with Ghostscript  from pdf:</strong></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p60code3'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p603"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p60code3"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">gs</span> <span style="color: #660033;">-q</span> <span style="color: #660033;">-r300</span> <span style="color: #660033;">-dBATCH</span> <span style="color: #660033;">-dNOPAUSE</span> <span style="color: #660033;">-sDEVICE</span>=tiff24nc  <span style="color: #660033;">-sOutputFile</span>=Dokument2.tif Dokument1.pdf</pre></td></tr></table></div>

<p><strong><br />
Now start OCR-recognition with tesseract-ocr (maybe you have to install it). </strong></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p60code4'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p604"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p60code4"><pre class="bash" style="font-family:monospace;"> tesseract Dokument2.tif doc.txt <span style="color: #660033;">-l</span> deu</pre></td></tr></table></div>

<p>-l deu means &#8220;Deutsch&#8221; for German language recognition.<br />
-r300 means 300 DPI</p>
<p>Now it is easy to create a script which will automatically check a folder for new files and start ocr etc. </p>
<p>E.g. you can create a shell-script and start this shell script via cronjob. Maybe I will write an example here later. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sobek.info/blog/2010/02/08/ocr-under-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a pdf from manpages</title>
		<link>http://www.sobek.info/blog/2010/01/16/create-a-pdf-from-manpages/</link>
		<comments>http://www.sobek.info/blog/2010/01/16/create-a-pdf-from-manpages/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 16:01:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[man]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://www.sobek.info/blog/?p=222</guid>
		<description><![CDATA[If you want to printout or save info from manpages simply type:

?View Code BASH1
man -t man &#124; ps2pdf - &#62; man.pdf

]]></description>
			<content:encoded><![CDATA[<p>If you want to printout or save info from manpages simply type:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p222code6'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p2226"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p222code6"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">man</span> <span style="color: #660033;">-t</span> <span style="color: #c20cb9; font-weight: bold;">man</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">ps2pdf</span> - <span style="color: #000000; font-weight: bold;">&gt;</span> man.pdf</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.sobek.info/blog/2010/01/16/create-a-pdf-from-manpages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Download files with curl</title>
		<link>http://www.sobek.info/blog/2009/12/20/download-files-with-curl/</link>
		<comments>http://www.sobek.info/blog/2009/12/20/download-files-with-curl/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 13:31:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MacOS]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://www.sobek.info/blog/?p=205</guid>
		<description><![CDATA[If you want to download a file with curl type the following code into bash:

?View Code BASH1
curl -O http://www.url.de/file.html

-O means to output to a file and not to stdout, normally the screen.
What if you need to resume a download of a big file?

?View Code BASH1
curl -C - -O http://www.url.de/file.html

With -C &#8211; you continue downloading the [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to download a file with curl type the following code into bash:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p205code10'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p20510"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p205code10"><pre class="bash" style="font-family:monospace;">curl <span style="color: #660033;">-O</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.url.de<span style="color: #000000; font-weight: bold;">/</span>file.html</pre></td></tr></table></div>

<p>-O means to output to a file and not to stdout, normally the screen.</p>
<p>What if you need to resume a download of a big file?</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p205code11'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p20511"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p205code11"><pre class="bash" style="font-family:monospace;">curl <span style="color: #660033;">-C</span> - <span style="color: #660033;">-O</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.url.de<span style="color: #000000; font-weight: bold;">/</span>file.html</pre></td></tr></table></div>

<p>With -C &#8211; you continue downloading the current file. If is important to write <strong>-C -</strong>. Don&#8217;t forget the -</p>
<p>You can also set a referrer and the user agent.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p205code12'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p20512"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p205code12"><pre class="bash" style="font-family:monospace;">curl <span style="color: #660033;">-C</span> - <span style="color: #660033;">-O</span> <span style="color: #660033;">-A</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.url.de <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6&quot;</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.url.de<span style="color: #000000; font-weight: bold;">/</span>file.html</pre></td></tr></table></div>

<p>With -A you can set the referrer and -e sets the user agent.</p>
<p>Pretty helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sobek.info/blog/2009/12/20/download-files-with-curl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux kernel compilation syntax</title>
		<link>http://www.sobek.info/blog/2009/12/14/linux-kernel-compilation-syntax/</link>
		<comments>http://www.sobek.info/blog/2009/12/14/linux-kernel-compilation-syntax/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 15:45:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[kernel compilation]]></category>

		<guid isPermaLink="false">http://www.sobek.info/blog/?p=79</guid>
		<description><![CDATA[After unpacking the Kernel Archive to &#8220;/usr/src&#8221; use the following:

?View Code BASH1
2
3
4
make dep
make clean
make bzImagemake modules
make modules_install

]]></description>
			<content:encoded><![CDATA[<div>After unpacking the Kernel Archive to &#8220;/usr/src&#8221; use the following:</div>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p79code14'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p7914"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p79code14"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span> dep
<span style="color: #c20cb9; font-weight: bold;">make</span> clean
<span style="color: #c20cb9; font-weight: bold;">make</span> bzImagemake modules
<span style="color: #c20cb9; font-weight: bold;">make</span> modules_install</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.sobek.info/blog/2009/12/14/linux-kernel-compilation-syntax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Send an E-Mail with Telnet via SMTP</title>
		<link>http://www.sobek.info/blog/2009/12/02/send-an-e-mail-with-telnet-via-smtp/</link>
		<comments>http://www.sobek.info/blog/2009/12/02/send-an-e-mail-with-telnet-via-smtp/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 10:52:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[send email]]></category>
		<category><![CDATA[send mail via telnet]]></category>
		<category><![CDATA[smtp]]></category>
		<category><![CDATA[telnet]]></category>

		<guid isPermaLink="false">http://www.sobek.info/blog/?p=68</guid>
		<description><![CDATA[How to send an email with telnet via smtp for testing purposes? Here is an example:

?View Code BASH1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
telnet  smtp.me.com 25
220 smtp.web.de ESMTP Web.de V4.91#2 Sun, 24 Nov 2009  16:51:20 +0100
&#160;
helo yourcomputername
250 smtp.web.de Hello yourcomputername &#91;219.99.999.999&#93;
&#160;
mail  from: account@web.de
250 account@web.de is syntactically  correct
&#160;
rcpt  to: empfaenger@provider.tld
250 empfaenger@provider.tld verified
&#160;
data
354 Enter message,  ending with [...]]]></description>
			<content:encoded><![CDATA[<p>How to send an email with telnet via smtp for testing purposes? Here is an example:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p68code18'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p6818"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code" id="p68code18"><pre class="bash" style="font-family:monospace;">telnet  smtp.me.com <span style="color: #000000;">25</span>
<span style="color: #000000;">220</span> smtp.web.de ESMTP Web.de V4.91<span style="color: #666666; font-style: italic;">#2 Sun, 24 Nov 2009  16:51:20 +0100</span>
&nbsp;
helo yourcomputername
250 smtp.web.de Hello yourcomputername <span style="color: #7a0874; font-weight: bold;">&#91;</span>219.99.999.999<span style="color: #7a0874; font-weight: bold;">&#93;</span>
&nbsp;
mail  from: account<span style="color: #000000; font-weight: bold;">@</span>web.de
250 account<span style="color: #000000; font-weight: bold;">@</span>web.de is syntactically  correct
&nbsp;
rcpt  to: empfaenger<span style="color: #000000; font-weight: bold;">@</span>provider.tld
250 empfaenger<span style="color: #000000; font-weight: bold;">@</span>provider.tld verified
&nbsp;
data
354 Enter message,  ending with . on  a line by itself
To: anton<span style="color: #000000; font-weight: bold;">@</span>tirol.at;
From: hugo<span style="color: #000000; font-weight: bold;">@</span>schlaumeier.de
Subject: Jodelei 
&nbsp;
Servus<span style="color: #000000; font-weight: bold;">!</span>
&nbsp;
Greetz,
Peterli
.
250 OK  <span style="color: #c20cb9; font-weight: bold;">id</span>=18Z6Uc-0001wm-00
&nbsp;
Quit
<span style="color: #000000;">221</span> smtp.web.de closing connection</pre></td></tr></table></div>

<p>To send mail with auth:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p68code19'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p6819"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
</pre></td><td class="code" id="p68code19"><pre class="bash" style="font-family:monospace;">telnet  smtp.me.com <span style="color: #000000;">25</span>
<span style="color: #000000;">220</span> smtp.web.de ESMTP Web.de V4.91<span style="color: #666666; font-style: italic;">#2 Sun, 24 Nov 2009  16:51:20 +0100</span>
&nbsp;
helo yourcomputername
250 smtp.web.de Hello yourcomputername <span style="color: #7a0874; font-weight: bold;">&#91;</span>219.99.999.999<span style="color: #7a0874; font-weight: bold;">&#93;</span>
&nbsp;
auth <span style="color: #c20cb9; font-weight: bold;">login</span>
334 VXNlcm5hbWU6
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;</span>base64 encoded username<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>repeated base64 encoded username<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>base64 encoded password<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>repeated base64 encoded password<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
235 Authentication successful
&nbsp;
mail  from: account<span style="color: #000000; font-weight: bold;">@</span>web.de
250 account<span style="color: #000000; font-weight: bold;">@</span>web.de is syntactically  correct
&nbsp;
rcpt  to: empfaenger<span style="color: #000000; font-weight: bold;">@</span>provider.tld
250 empfaenger<span style="color: #000000; font-weight: bold;">@</span>provider.tld verified
&nbsp;
data
354 Enter message,  ending with . on  a line by itself
&nbsp;
Subject: Jodelei 
&nbsp;
Servus<span style="color: #000000; font-weight: bold;">!</span>
&nbsp;
Greetz,
Peterli
.
250 OK  <span style="color: #c20cb9; font-weight: bold;">id</span>=18Z6Uc-0001wm-00
&nbsp;
Quit
<span style="color: #000000;">221</span> smtp.web.de closing connection</pre></td></tr></table></div>

<p>To base64 encode your username or pass, use another linux terminal and type:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p68code20'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p6820"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p68code20"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">printf</span> username <span style="color: #000000; font-weight: bold;">|</span> base64
<span style="color: #7a0874; font-weight: bold;">printf</span> password <span style="color: #000000; font-weight: bold;">|</span> base64</pre></td></tr></table></div>

<p>If you don&#8217;t have base64 on your system try mimencode instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sobek.info/blog/2009/12/02/send-an-e-mail-with-telnet-via-smtp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>scroll in screen</title>
		<link>http://www.sobek.info/blog/2009/12/02/scroll-in-screen/</link>
		<comments>http://www.sobek.info/blog/2009/12/02/scroll-in-screen/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 09:02:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[scroll]]></category>

		<guid isPermaLink="false">http://www.sobek.info/blog/?p=149</guid>
		<description><![CDATA[To scroll in screen-mode of linux type the following:
Strg+a then AltGr+8
Now you can scroll up and down. This is called the copy-mode. 
Source: http://blog.pregos.info/2009/02/26/scrollen-im-screen/
]]></description>
			<content:encoded><![CDATA[<p>To scroll in screen-mode of linux type the following:<br />
<strong>Strg+a then AltGr+8</strong></p>
<p>Now you can scroll up and down. This is called the copy-mode. </p>
<p>Source: <a href="http://blog.pregos.info/2009/02/26/scrollen-im-screen/">http://blog.pregos.info/2009/02/26/scrollen-im-screen/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sobek.info/blog/2009/12/02/scroll-in-screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tar with split syntax</title>
		<link>http://www.sobek.info/blog/2009/11/30/tar-with-split-syntax/</link>
		<comments>http://www.sobek.info/blog/2009/11/30/tar-with-split-syntax/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 11:31:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[archive]]></category>
		<category><![CDATA[cat]]></category>
		<category><![CDATA[split files]]></category>
		<category><![CDATA[tar]]></category>

		<guid isPermaLink="false">http://www.sobek.info/blog/?p=77</guid>
		<description><![CDATA[This is an example from http://www.linux-user.de/ausgabe/2001/07/030-split/split.html:

?View Code BASH1
tar cz /home/user  &#124; split -b95m - archiv.tgz.split.

Put together files with:

?View Code BASH1
cat  &#91;dateiname&#93;.split.* &#124; tar x

]]></description>
			<content:encoded><![CDATA[<p>This is an example from <a href="http://www.linux-user.de/ausgabe/2001/07/030-split/split.html">http://www.linux-user.de/ausgabe/2001/07/030-split/split.html</a>:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p77code23'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p7723"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p77code23"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> cz <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>user  <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">split</span> <span style="color: #660033;">-b95m</span> - archiv.tgz.split.</pre></td></tr></table></div>

<p>Put together files with:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p77code24'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p7724"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p77code24"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cat</span>  <span style="color: #7a0874; font-weight: bold;">&#91;</span>dateiname<span style="color: #7a0874; font-weight: bold;">&#93;</span>.split.<span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> x</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.sobek.info/blog/2009/11/30/tar-with-split-syntax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Search and replace with linux in files</title>
		<link>http://www.sobek.info/blog/2009/11/25/search-and-replace-with-linux-in-files/</link>
		<comments>http://www.sobek.info/blog/2009/11/25/search-and-replace-with-linux-in-files/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 15:39:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MacOS]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[search and replace]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://www.sobek.info/blog/?p=56</guid>
		<description><![CDATA[To replace a string in all files inside a folder you can create a bash file:

?View Code BASH1
vi replace.sh

Put inside this file:

?View Code BASH1
2
3
4
5
6
#!/bin/bash
for file in $&#40;ls -1&#41;;
do
sed 's/me/you/g' $file &#38;gt; /tmp/dummy.txt;
mv /tmp/dummy.txt $file;
done

Save it and make it executeable (chmod 777 replace.sh)
In this case the string &#8220;me&#8221; will be replace with &#8220;you&#8221; in all files [...]]]></description>
			<content:encoded><![CDATA[<p>To replace a string in all files inside a folder you can create a bash file:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p56code29'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p5629"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p56code29"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vi</span> replace.sh</pre></td></tr></table></div>

<p>Put inside this file:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p56code30'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p5630"><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p56code30"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">ls</span> -1<span style="color: #7a0874; font-weight: bold;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">do</span>
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/me/you/g'</span> <span style="color: #007800;">$file</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>dummy.txt;
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>dummy.txt <span style="color: #007800;">$file</span>;
<span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>

<p>Save it and make it executeable (chmod 777 replace.sh)</p>
<div>In this case the string &#8220;me&#8221; will be replace with &#8220;you&#8221; in all files of the actual folder and the files will be overridden.</div>
<div></div>
<div><strong>Another example</strong></div>
<div>Your want to replace the tag &lt;b&gt; with &lt;strong&gt; in all files inside a special folder. Further you want to backup the original files with suffix .old and the new files will be overridden.</div>
<div></div>
<div>Simply type on the console:</div>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p56code31'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p5631"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p56code31"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">ls</span> -1<span style="color: #7a0874; font-weight: bold;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">do</span>
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #007800;">$file</span> <span style="color: #007800;">$file</span>.old
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/&amp;lt;b&amp;gt;/&amp;lt;strong&amp;gt;/g'</span> <span style="color: #007800;">$file</span>.old <span style="color: #000000; font-weight: bold;">&amp;</span>gt;  <span style="color: #007800;">$file</span>;
<span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>

<div>You can modify the script(s). Maybe by adding parameters etc.</div>
<p>Another option is to use sed with -i command or direct editing:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p56code32'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p5632"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p56code32"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">ls</span> -1<span style="color: #7a0874; font-weight: bold;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">do</span>
<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">'s/text_to_replace/text_replacement/g'</span> <span style="color: #007800;">$file</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.sobek.info/blog/2009/11/25/search-and-replace-with-linux-in-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Screen command usage &#8211; part 1</title>
		<link>http://www.sobek.info/blog/2009/11/25/screen-command-usage-part/</link>
		<comments>http://www.sobek.info/blog/2009/11/25/screen-command-usage-part/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 13:59:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Console]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[sreen]]></category>

		<guid isPermaLink="false">http://www.sobek.info/blog/?p=48</guid>
		<description><![CDATA[People often underestimate the usefulness of the linux-command screen.
What does screen do? Screen creates a terminal session for the actual user.
Type:

?View Code BASH1
screen

to create a terminal session.
Or type:

?View Code BASH1
screen -S &#60;sessionname&#62;

where &#60;sessionname&#62; should be replaced with your own name.
Create a new window:

?View Code BASH1
Crtl+a c

which means (Press Control and a together and after that [...]]]></description>
			<content:encoded><![CDATA[<p>People often underestimate the usefulness of the linux-command screen.</p>
<p>What does screen do? Screen creates a terminal session for the actual user.</p>
<p>Type:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p48code40'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p4840"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p48code40"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">screen</span></pre></td></tr></table></div>

<p>to create a terminal session.</p>
<p>Or type:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p48code41'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p4841"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p48code41"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-S</span> <span style="color: #000000; font-weight: bold;">&lt;</span>sessionname<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>where &lt;sessionname&gt; should be replaced with your own name.</p>
<p>Create a new window:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p48code42'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p4842"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p48code42"><pre class="bash" style="font-family:monospace;">Crtl+a c</pre></td></tr></table></div>

<p>which means (Press Control and a together and after that press c)</p>
<p>Now we created a second window. To list all created windows in the actual session type:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p48code43'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p4843"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p48code43"><pre class="bash" style="font-family:monospace;">Crtl+a <span style="color: #ff0000;">&quot;</span></pre></td></tr></table></div>

<p>Germans have to press Shift+2 for &#8220;.</p>
<p>Now the two created windows will be shown:</p>
<p><img class="alignnone size-full wp-image-50" title="Bildschirmfoto 2009-11-25 um 14.55.07" src="http://www.sobek.info/blog/wp-content/Bildschirmfoto-2009-11-25-um-14.55.071.png" alt="Bildschirmfoto 2009-11-25 um 14.55.07" width="607" height="269" /></p>
<p>Just choose one Window and press enter.</p>
<p>To quit your actual work an detach the session:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p48code44'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p4844"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p48code44"><pre class="bash" style="font-family:monospace;">Crtl+a d</pre></td></tr></table></div>

<p>To list all active sessions:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p48code45'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p4845"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p48code45"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-list</span></pre></td></tr></table></div>

<p>You should see a similar picture like the following:</p>
<p><img class="alignnone size-full wp-image-53" title="Bildschirmfoto 2009-11-25 um 15.03.27" src="http://www.sobek.info/blog/wp-content/Bildschirmfoto-2009-11-25-um-15.03.27.png" alt="Bildschirmfoto 2009-11-25 um 15.03.27" width="423" height="108" /></p>
<p>Here you can see the name of the session: 1597.stefan</p>
<p>To restore the session simply type:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p48code46'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p4846"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p48code46"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-r</span> stefan</pre></td></tr></table></div>

<p>Maybe you have to type the complete id with 1597.stefan if there exist another session with the same name.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sobek.info/blog/2009/11/25/screen-command-usage-part/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top command differences in Linux and Mac</title>
		<link>http://www.sobek.info/blog/2009/11/19/top-command-differences-in-linux-and-mac/</link>
		<comments>http://www.sobek.info/blog/2009/11/19/top-command-differences-in-linux-and-mac/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 08:46:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MacOS]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[top]]></category>

		<guid isPermaLink="false">http://www.sobek.info/blog/?p=45</guid>
		<description><![CDATA[When switching from Mac to Linux and vice versa, I always have to think a bit about how to use the command top and sort by CPU.
With Linux it is
top
and then press
shift+p
Mac:
top -o cpu
I hope I can remember this  
]]></description>
			<content:encoded><![CDATA[<p>When switching from Mac to Linux and vice versa, I always have to think a bit about how to use the command top and sort by CPU.</p>
<p>With <strong>Linux</strong> it is</p>
<blockquote><p>top</p></blockquote>
<p>and then press</p>
<blockquote><p>shift+p</p></blockquote>
<p><strong>Mac</strong>:</p>
<blockquote><p>top -o cpu</p></blockquote>
<p>I hope I can remember this <img src='http://www.sobek.info/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sobek.info/blog/2009/11/19/top-command-differences-in-linux-and-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

