<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
	<id>https://doc.ycharbi.fr/index.php?action=history&amp;feed=atom&amp;title=GNU_history</id>
	<title>GNU history - Historique des versions</title>
	<link rel="self" type="application/atom+xml" href="https://doc.ycharbi.fr/index.php?action=history&amp;feed=atom&amp;title=GNU_history"/>
	<link rel="alternate" type="text/html" href="https://doc.ycharbi.fr/index.php?title=GNU_history&amp;action=history"/>
	<updated>2026-04-19T20:36:57Z</updated>
	<subtitle>Historique des versions pour cette page sur le wiki</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://doc.ycharbi.fr/index.php?title=GNU_history&amp;diff=1377&amp;oldid=prev</id>
		<title>Ycharbi : Ajout d'une méthode pour ne supprimer qu'une seule entrée de l'historique + remplacement des balises &quot;source&quot; obsolètes par &quot;syntaxhighlight&quot;</title>
		<link rel="alternate" type="text/html" href="https://doc.ycharbi.fr/index.php?title=GNU_history&amp;diff=1377&amp;oldid=prev"/>
		<updated>2022-07-20T13:36:05Z</updated>

		<summary type="html">&lt;p&gt;Ajout d&amp;#039;une méthode pour ne supprimer qu&amp;#039;une seule entrée de l&amp;#039;historique + remplacement des balises &amp;quot;source&amp;quot; obsolètes par &amp;quot;syntaxhighlight&amp;quot;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;fr&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Version précédente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version du 20 juillet 2022 à 15:36&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Ligne 1 :&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Ligne 1 :&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:linux]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:linux]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;''GNU history'' est un outil permettant d'afficher l'historique des commandes sous ''Linux''. Celui-ci est localisé dans le fichier &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source &lt;/del&gt;lang=&quot;bash&quot; inline&amp;gt;~/.bash_history&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source&lt;/del&gt;&amp;gt; de chaque utilisateur exécutant le [[Shell bash|Shell Bash]].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;''GNU history'' est un outil permettant d'afficher l'historique des commandes sous ''Linux''. Celui-ci est localisé dans le fichier &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight &lt;/ins&gt;lang=&quot;bash&quot; inline&amp;gt;~/.bash_history&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight&lt;/ins&gt;&amp;gt; de chaque utilisateur exécutant le [[Shell bash|Shell Bash]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{info|Le fonctionnement de l'historique avec ''Bash'' est particulier. Ce dernier enregistre les commandes tapées en ''RAM'' et ne les écrits dans le fichier &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source &lt;/del&gt;lang=&quot;bash&quot; inline&amp;gt;~/.bash_history&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source&lt;/del&gt;&amp;gt; qu'une fois la session terminée. De plus, si vous avez plusieurs ''TTY'' en même temps, l'historique ne sera pas forcement sauvegardé... Ne comptez pas trop sur cette fonctionnalité d'un autre âge pour avoir un suivit infaillible de vos actions.}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{info|Le fonctionnement de l'historique avec ''Bash'' est particulier. Ce dernier enregistre les commandes tapées en ''RAM'' et ne les écrits dans le fichier &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight &lt;/ins&gt;lang=&quot;bash&quot; inline&amp;gt;~/.bash_history&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight&lt;/ins&gt;&amp;gt; qu'une fois la session terminée. De plus, si vous avez plusieurs ''TTY'' en même temps, l'historique ne sera pas forcement sauvegardé... Ne comptez pas trop sur cette fonctionnalité d'un autre âge pour avoir un suivit infaillible de vos actions.}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Pour afficher la liste des commandes tapées précédemment, il suffit d'exécuter le programme sans arguments:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Pour afficher la liste des commandes tapées précédemment, il suffit d'exécuter le programme sans arguments:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  history&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  history&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Contrairement à son pendant [[:Category:bsd|BSD]] (qui utilise l'option &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source &lt;/del&gt;lang=&quot;bash&quot; inline&amp;gt;-h&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source&lt;/del&gt;&amp;gt;), il n'existe pas de paramètre pour n'afficher que les commandes (sans leur numéro). Pour ce faire, il faudra tronquer les chaînes de caractères [https://pensebetedelad.blogspot.com/2014/10/bash-sh-faire-un-historique-des.html comme ceci]:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Contrairement à son pendant [[:Category:bsd|BSD]] (qui utilise l'option &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight &lt;/ins&gt;lang=&quot;bash&quot; inline&amp;gt;-h&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight&lt;/ins&gt;&amp;gt;), il n'existe pas de paramètre pour n'afficher que les commandes (sans leur numéro). Pour ce faire, il faudra tronquer les chaînes de caractères [https://pensebetedelad.blogspot.com/2014/10/bash-sh-faire-un-historique-des.html comme ceci]:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  history | awk '{$1=&amp;quot;&amp;quot;;print substr($0,2)}'&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  history | awk '{$1=&amp;quot;&amp;quot;;print substr($0,2)}'&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Pour vider l'historique, il faut généralement passer par deux étapes:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Pour vider l'historique, il faut généralement passer par deux étapes :&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Suppression du fichier journal: &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source &lt;/del&gt;lang=&quot;bash&quot; inline&amp;gt;rm ~/.bash_history&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Suppression du fichier journal: &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight &lt;/ins&gt;lang=&quot;bash&quot; inline&amp;gt;rm ~/.bash_history&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Suppression du tampon: &amp;lt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source &lt;/del&gt;lang=&quot;bash&quot; inline&amp;gt;history -c&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;source&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* Suppression du tampon: &amp;lt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight &lt;/ins&gt;lang=&quot;bash&quot; inline&amp;gt;history -c&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxhighlight&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Il est également possible de ne supprimer qu'une entrée en particulier en précisant son numéro :&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; history -d 1994&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Ycharbi</name></author>
	</entry>
	<entry>
		<id>https://doc.ycharbi.fr/index.php?title=GNU_history&amp;diff=1177&amp;oldid=prev</id>
		<title>Ycharbi : Page créée avec « Category:linux  ''GNU history'' est un outil permettant d'afficher l'historique des commandes sous ''Linux''. Celui-ci est localisé dans le fichier &lt;source lang=&quot;bash... »</title>
		<link rel="alternate" type="text/html" href="https://doc.ycharbi.fr/index.php?title=GNU_history&amp;diff=1177&amp;oldid=prev"/>
		<updated>2020-07-30T17:46:07Z</updated>

		<summary type="html">&lt;p&gt;Page créée avec « &lt;a href=&quot;/index.php/Cat%C3%A9gorie:Linux&quot; title=&quot;Catégorie:Linux&quot;&gt;Category:linux&lt;/a&gt;  &amp;#039;&amp;#039;GNU history&amp;#039;&amp;#039; est un outil permettant d&amp;#039;afficher l&amp;#039;historique des commandes sous &amp;#039;&amp;#039;Linux&amp;#039;&amp;#039;. Celui-ci est localisé dans le fichier &amp;lt;source lang=&amp;quot;bash... »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:linux]]&lt;br /&gt;
&lt;br /&gt;
''GNU history'' est un outil permettant d'afficher l'historique des commandes sous ''Linux''. Celui-ci est localisé dans le fichier &amp;lt;source lang=&amp;quot;bash&amp;quot; inline&amp;gt;~/.bash_history&amp;lt;/source&amp;gt; de chaque utilisateur exécutant le [[Shell bash|Shell Bash]].&lt;br /&gt;
&lt;br /&gt;
{{info|Le fonctionnement de l'historique avec ''Bash'' est particulier. Ce dernier enregistre les commandes tapées en ''RAM'' et ne les écrits dans le fichier &amp;lt;source lang=&amp;quot;bash&amp;quot; inline&amp;gt;~/.bash_history&amp;lt;/source&amp;gt; qu'une fois la session terminée. De plus, si vous avez plusieurs ''TTY'' en même temps, l'historique ne sera pas forcement sauvegardé... Ne comptez pas trop sur cette fonctionnalité d'un autre âge pour avoir un suivit infaillible de vos actions.}}&lt;br /&gt;
&lt;br /&gt;
Pour afficher la liste des commandes tapées précédemment, il suffit d'exécuter le programme sans arguments:&lt;br /&gt;
 history&lt;br /&gt;
&lt;br /&gt;
Contrairement à son pendant [[:Category:bsd|BSD]] (qui utilise l'option &amp;lt;source lang=&amp;quot;bash&amp;quot; inline&amp;gt;-h&amp;lt;/source&amp;gt;), il n'existe pas de paramètre pour n'afficher que les commandes (sans leur numéro). Pour ce faire, il faudra tronquer les chaînes de caractères [https://pensebetedelad.blogspot.com/2014/10/bash-sh-faire-un-historique-des.html comme ceci]:&lt;br /&gt;
 history | awk '{$1=&amp;quot;&amp;quot;;print substr($0,2)}'&lt;br /&gt;
&lt;br /&gt;
Pour vider l'historique, il faut généralement passer par deux étapes:&lt;br /&gt;
* Suppression du fichier journal: &amp;lt;source lang=&amp;quot;bash&amp;quot; inline&amp;gt;rm ~/.bash_history&amp;lt;/source&amp;gt;&lt;br /&gt;
* Suppression du tampon: &amp;lt;source lang=&amp;quot;bash&amp;quot; inline&amp;gt;history -c&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ycharbi</name></author>
	</entry>
</feed>