<?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>blog.motarion.net &#187; Debian</title>
	<atom:link href="http://blog.motarion.net/tag/debian/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.motarion.net</link>
	<description>Par un joueur FR, pour des joueurs FR !</description>
	<lastBuildDate>Fri, 27 Aug 2010 16:27:28 +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>BASH &#8211; Rajouter la date dans l&#8217;historique des commandes</title>
		<link>http://blog.motarion.net/2009/04/18/bash-rajouter-la-date-dans-lhistorique-des-commandes/</link>
		<comments>http://blog.motarion.net/2009/04/18/bash-rajouter-la-date-dans-lhistorique-des-commandes/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 12:40:12 +0000</pubDate>
		<dc:creator>Motarion</dc:creator>
				<category><![CDATA[Libre]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Administration Système]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sécurité]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://blog.motarion.net/?p=183</guid>
		<description><![CDATA[<br/>Après avoir eu un serveur de piraté j&#8217;ai pu voir les commande qu&#8217;avait passé le pirate, sans pouvoir savoir exactement quand il les avait utilisées (Il n&#8217;avait pas nettoyé l&#8217;historique). J&#8217;ai donc cherché sur Internet une solution sans trouver grand chose pour Bash. Cette modification est totalement anodine pour le système et ne peut entraîner [...]]]></description>
			<content:encoded><![CDATA[<br/><p>Après avoir eu un serveur de piraté j&#8217;ai pu voir les commande qu&#8217;avait passé le pirate, sans pouvoir savoir exactement quand il les avait utilisées (Il n&#8217;avait pas nettoyé l&#8217;historique). J&#8217;ai donc cherché sur Internet une solution sans trouver grand chose pour Bash.</p>
<p><strong>Cette modification est totalement anodine pour le système et ne peut entraîner de perte de donnée</strong>.</p>
<p>Après avoir acheter un <a href="http://www.eyrolles.com/Informatique/Livre/learning-the-bash-shell-9780596009656" target="_blank">livre sur Bash</a> j&#8217;ai trouvé mon bonheur. Il faut absolument avoir la version 3.0 ou plus de bash. <a href="http://www.ubuntu.com/" target="_blank"><strong>Ubuntu Dapper Drake</strong></a> et les version suivante intègre d&#8217;office une version supérieur à la 3.0.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">motarion<span style="color: #000000; font-weight: bold;">@</span>cyber-workstation:~$ <span style="color: #c20cb9; font-weight: bold;">bash</span> <span style="color: #660033;">--version</span>
GNU <span style="color: #c20cb9; font-weight: bold;">bash</span>, version 3.2.39<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>-release <span style="color: #7a0874; font-weight: bold;">&#40;</span>i486-pc-linux-gnu<span style="color: #7a0874; font-weight: bold;">&#41;</span>
Copyright <span style="color: #7a0874; font-weight: bold;">&#40;</span>C<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">2007</span> Free Software Foundation, Inc.</pre></div></div>

<p>Pour activer la date dans l&#8217;historique il suffit de lancer la commande suivante:</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;">HISTTIMEFORMAT</span>=<span style="color: #ff0000;">&quot;%Y/%m/%d @ %T &quot;</span></pre></div></div>

<p>Voici le résultat:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">  <span style="color: #000000;">456</span>  <span style="color: #000000;">2009</span><span style="color: #000000; font-weight: bold;">/</span>04<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">18</span> <span style="color: #000000; font-weight: bold;">@</span> <span style="color: #000000;">13</span>:<span style="color: #000000;">58</span>:<span style="color: #000000;">32</span> <span style="color: #c20cb9; font-weight: bold;">ping</span> free.fr
  <span style="color: #000000;">457</span>  <span style="color: #000000;">2009</span><span style="color: #000000; font-weight: bold;">/</span>04<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">18</span> <span style="color: #000000; font-weight: bold;">@</span> <span style="color: #000000;">13</span>:<span style="color: #000000;">58</span>:<span style="color: #000000;">35</span> <span style="color: #c20cb9; font-weight: bold;">ls</span>
  <span style="color: #000000;">458</span>  <span style="color: #000000;">2009</span><span style="color: #000000; font-weight: bold;">/</span>04<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">18</span> <span style="color: #000000; font-weight: bold;">@</span> <span style="color: #000000;">13</span>:<span style="color: #000000;">58</span>:<span style="color: #000000;">48</span> spas
  <span style="color: #000000;">459</span>  <span style="color: #000000;">2009</span><span style="color: #000000; font-weight: bold;">/</span>04<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">18</span> <span style="color: #000000; font-weight: bold;">@</span> <span style="color: #000000;">13</span>:<span style="color: #000000;">58</span>:<span style="color: #000000;">55</span> <span style="color: #7a0874; font-weight: bold;">history</span></pre></div></div>

<p><strong>Attention</strong>: cette modification n&#8217;est pas persistente et si vous fermez le SHELL actuel la modification sera perdue!</p>
<p>Pour rendre cette modification persistente il y a deux solutions:</p>
<ul>
<li>Modifier le fichier .bashrc de chaque utilisateur</li>
<li>Modifier la configuration Globale de Bash</li>
</ul>
<ol></ol>
<p>I &#8211; Pour la première solution, il faut savoir que les nouveaux utilisateur ne profiteront pas de la modification. Si vous êtes le seul à vous connecter dans ce cas c&#8217;est la solution la plus simple. Lancez l&#8217;éditeur de texte que vous préférez puis copier la ligne suivante en fin de fichier:</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;">HISTTIMEFORMAT</span>=<span style="color: #ff0000;">&quot;%Y/%m/%d @ %T &quot;</span></pre></div></div>

<p>Édition du fichier:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">nano</span> .bashrc</pre></div></div>

<p>II &#8211; La seconde solution permet de l&#8217;activer pour tout le système, même pour les nouveaux utilisateurs:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">nano</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>bash.bashrc</pre></div></div>

<p>Puis copiez en fin de fichier la commande suivante:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">HISTTIMEFORMAT</span>=<span style="color: #ff0000;">&quot;%Y/%m/%d @ %T &quot;</span></pre></div></div>

<p>Vous pourrez alors constater que la modification est active pour tous les nouveaux Shell que vous ouvrirez.</p>
<p><strong>PS</strong>: Cette astuce fonctionne aussi sur Debian depuis la version Etch bien que le chemin de configuration de bash puisse changer.</p>
<div id="seolinx-tooltip" style="border: 1px solid #000000; margin: 0pt; padding: 0pt; display: none; opacity: 0.9; position: absolute; width: auto; z-index: 99999;">
<table style="border: 0pt none; margin: 0pt; padding: 0pt; border-collapse: separate; width: auto;" border="0">
<tbody>
<tr>
<td id="seolinx-table" style="border: 0pt none; margin: 1px; padding: 0pt; font-family: Tahoma; font-size: 11px; font-weight: bold;">
<div style="margin: 0pt; padding: 0pt; overflow: auto; width: auto;">
<table id="seolinx-paramtable" style="border: 1px solid gray; margin: 0pt; border-collapse: separate;" border="0">
<tbody>
<tr>
<td style="border: 1px solid gray; padding: 2px; background: #f0f0f0 none repeat scroll 0% 0%; color: darkgreen; font-family: Tahoma; font-size: 7pt; font-weight: bold; white-space: nowrap;"><img style="vertical-align: middle;" src="http://toolbarqueries.google.com/favicon.ico" alt="" width="12" height="12" /> PR: <a style="color: blue; font-family: Tahoma; font-size: 7pt; font-weight: bold; text-decoration: underline;" title="Google pagerank" href="javascript:{}">wait&#8230;</a></td>
<td style="border: 1px solid gray; padding: 2px; background: #f0f0f0 none repeat scroll 0% 0%; color: darkgreen; font-family: Tahoma; font-size: 7pt; font-weight: bold; white-space: nowrap;"><img style="vertical-align: middle;" src="http://www.google.com/favicon.ico" alt="" width="12" height="12" /> I: <a style="color: blue; font-family: Tahoma; font-size: 7pt; font-weight: bold; text-decoration: underline;" title="Google index" href="javascript:{}">wait&#8230;</a></td>
<td style="border: 1px solid gray; padding: 2px; background: #f0f0f0 none repeat scroll 0% 0%; color: darkgreen; font-family: Tahoma; font-size: 7pt; font-weight: bold; white-space: nowrap;"><img style="vertical-align: middle;" src="http://www.google.com/favicon.ico" alt="" width="12" height="12" /> L: <a style="color: blue; font-family: Tahoma; font-size: 7pt; font-weight: bold; text-decoration: underline;" title="Google links" href="javascript:{}">wait&#8230;</a></td>
<td style="border: 1px solid gray; padding: 2px; background: #f0f0f0 none repeat scroll 0% 0%; color: darkgreen; font-family: Tahoma; font-size: 7pt; font-weight: bold; white-space: nowrap;"><img style="vertical-align: middle;" src="http://siteexplorer.search.yahoo.com/favicon.ico" alt="" width="12" height="12" /> LD: <a style="color: blue; font-family: Tahoma; font-size: 7pt; font-weight: bold; text-decoration: underline;" title="Yahoo linkdomain" href="javascript:{}">wait&#8230;</a></td>
<td style="border: 1px solid gray; padding: 2px; background: #f0f0f0 none repeat scroll 0% 0%; color: darkgreen; font-family: Tahoma; font-size: 7pt; font-weight: bold; white-space: nowrap;"><img style="vertical-align: middle;" src="http://search.msn.com/favicon.ico" alt="" width="12" height="12" /> I: <a style="color: blue; font-family: Tahoma; font-size: 7pt; font-weight: bold; text-decoration: underline;" title="MSN index" href="javascript:{}">wait&#8230;</a></td>
<td style="border: 1px solid gray; padding: 2px; background: #f0f0f0 none repeat scroll 0% 0%; color: darkgreen; font-family: Tahoma; font-size: 7pt; font-weight: bold; white-space: nowrap;"><a style="color: blue; font-family: Tahoma; font-size: 7pt; font-weight: bold; text-decoration: underline;" title="Sitemap.xml" href="javascript:{}">wait&#8230;</a></td>
<td style="border: 1px solid gray; padding: 2px; background: #f0f0f0 none repeat scroll 0% 0%; color: darkgreen; font-family: Tahoma; font-size: 7pt; font-weight: bold; white-space: nowrap;"><img style="vertical-align: middle;" src="http://www.semrush.com/favicon.ico" alt="" width="12" height="12" /> Rank: <a style="color: blue; font-family: Tahoma; font-size: 7pt; font-weight: bold; text-decoration: underline;" title="SEMRush Rank" href="javascript:{}">wait&#8230;</a></td>
<td style="border: 1px solid gray; padding: 2px; background: #f0f0f0 none repeat scroll 0% 0%; color: darkgreen; font-family: Tahoma; font-size: 7pt; font-weight: bold; white-space: nowrap;"><img style="vertical-align: middle;" src="http://www.semrush.com/favicon.ico" alt="" width="12" height="12" /> Traffic: <a style="color: blue; font-family: Tahoma; font-size: 7pt; font-weight: bold; text-decoration: underline;" title="SEMRush SE Traffic" href="javascript:{}">wait&#8230;</a></td>
<td style="border: 1px solid gray; padding: 2px; background: #f0f0f0 none repeat scroll 0% 0%; color: darkgreen; font-family: Tahoma; font-size: 7pt; font-weight: bold; white-space: nowrap;"><img style="vertical-align: middle;" src="http://www.semrush.com/favicon.ico" alt="" width="12" height="12" /> Price: <a style="color: blue; font-family: Tahoma; font-size: 7pt; font-weight: bold; text-decoration: underline;" title="SEMRush SE Traffic price" href="javascript:{}">wait&#8230;</a></td>
<td style="border: 1px solid gray; padding: 2px; background: #f0f0f0 none repeat scroll 0% 0%; color: darkgreen; font-family: Tahoma; font-size: 7pt; font-weight: bold; white-space: nowrap;"><img style="vertical-align: middle;" src="http://siteanalytics.compete.com/favicon.ico" alt="" width="12" height="12" /> C: <a style="color: blue; font-family: Tahoma; font-size: 7pt; font-weight: bold; text-decoration: underline;" title="Compete Rank" href="javascript:{}">wait&#8230;</a></td>
</tr>
</tbody>
</table>
</div>
</td>
<td id="seolinx-tooltip-close" style="border: 0pt none; margin: 0pt; padding: 1px; cursor: pointer; vertical-align: middle; width: auto;" title="close"><img src="chrome://seoquake/content/skin/close.gif" alt="" /></td>
</tr>
</tbody>
</table>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.motarion.net/2009/04/18/bash-rajouter-la-date-dans-lhistorique-des-commandes/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
