<?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>dhde.de &#187; History</title>
	<atom:link href="http://www.dhde.de/tag/history/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dhde.de</link>
	<description>dhde.de über das Leben und Dinge die keiner braucht</description>
	<lastBuildDate>Tue, 24 Aug 2010 12:52:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>HOWTO: bash history &#8211; HISTCONTROL</title>
		<link>http://www.dhde.de/2009/07/bash-history/</link>
		<comments>http://www.dhde.de/2009/07/bash-history/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 09:47:34 +0000</pubDate>
		<dc:creator>Dietrich Heise</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[History]]></category>
		<category><![CDATA[howto]]></category>

		<guid isPermaLink="false">http://www.dhde.de/?p=62</guid>
		<description><![CDATA[Die bash besitzt eine Reihe nützlicher Einstellungen: z.B. kann man mit den Tasten [ctrl]+[r] in der bash-history suchen. Die history protokolliert in der Regel alle commands, die eingegeben werden und mit enter bestätigt werden. Es gibt jedoch dummerweise wie bei jeder Regel Ausnahmen In der default-Eintellung z.B. werden keine Zeilen protokolliert die mit einem whitespace [...]]]></description>
			<content:encoded><![CDATA[<p>Die <em>bash</em> besitzt eine Reihe nützlicher Einstellungen:</p>
<p>z.B. kann man mit den Tasten <code>[ctrl]+[r]</code> in der bash-history suchen. Die <em>history</em> protokolliert in der Regel alle <em>commands</em>, die eingegeben werden und mit <em>enter</em> bestätigt werden. Es gibt jedoch dummerweise wie bei jeder Regel Ausnahmen <img src='http://www.dhde.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>In der <em>default</em>-Eintellung z.B. werden keine Zeilen protokolliert die mit einem <em>whitespace</em> beginnen. Diese Einstellung kann jedoch mit der Umgebungsvariable HISTCONTROL bearbeitet werden.</p>
<p>Hier der Eintag in der <em>man page</em> der <em>bash</em>:</p>
<blockquote><p>HISTCONTROL<br />
A colon-separated list of values controlling how commands are saved on the history list.  If  the  list  of  values  includes ignorespace,  lines which begin with a space character are not saved in the history list.  A value of ignoredups causes lines matching the previous history entry to not be saved.  A value of ignoreboth is shorthand for ignorespace and  ignoredups.   A value  of  erasedups causes all previous lines matching the current line to be removed from the history list before that line is saved.  Any value not in the above list is ignored.  If HISTCONTROL is unset, or does not include a valid value, all lines read  by the shell parser are saved on the history list, subject to the value of HISTIGNORE.  The second and subsequent lines of a multi-line compound command are not tested, and are added to the history regardless of the value of HISTCONTROL.</p></blockquote>
<p><strong><code>HISTCONTROL</code></strong><br />
Dieser Parameter erwartet einen der folgenden Strings: &#8220;<code>ignorespace</code>&#8220;, &#8220;<code>ignoredups</code>&#8221; oder &#8220;<code>ignoreboth</code>&#8220;.</p>
<p>Die erste Option speichert alle Zeilen die mit einem <em>space</em> beginnen <strong>nicht</strong> in der <em>history</em>.<br />
Der Zweite löscht alle doppelten Zeilen und behält immer die Jüngste.<br />
Naja und &#8220;<code>ignoreboth</code>&#8221; steht eben für beide Einstellungen zusammen.<br />
Will man wirklich alles in der history behalten, so ist die die HISTCONTROL=&#8221;" zu setzen <img src='http://www.dhde.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Dieser Parameter kann global in z.B. der Datei /etc/bashrc oder /etc/bash/bashrc (je nach Linux Distribution) gesetzt werden, oder Benutzer spezifisch in der Datei ~/.bashrc</p>
<p>Hier kann man z.B. eine der folgenden Zeilen eintragen:<br />
Um sowohl doppelte Eingaben sowie Eingaben die mit einem <em>whitespace</em> beginnen <strong>nicht</strong> zu protokollieren:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HISTCONTROL</span>=ignoreboth</pre></div></div>

<p>Um Eingaben die mit einem <em>whitespace</em> beginnen <strong>nicht</strong> zu protokollieren:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HISTCONTROL</span>=ignorespace</pre></div></div>

<p>Um doppelte Eingaben <strong>nicht</strong> zu protokollieren:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HISTCONTROL</span>=ignoredups</pre></div></div>

<p>Um <strong>alles</strong> zu protokollieren:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HISTCONTROL</span>=<span style="color: #ff0000;">&quot;&quot;</span></pre></div></div>

<div class="shr-publisher-62"></div>]]></content:encoded>
			<wfw:commentRss>http://www.dhde.de/2009/07/bash-history/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
