<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
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/"
> <channel><title>Comments on: Shell tip: Clear the command history and screen when you log out</title> <atom:link href="http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html/feed" rel="self" type="application/rss+xml" /><link>http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html</link> <description>This is a Linux sys admin journal by Vivek about sys admin work, Linux tips &#38; tricks, hacks, news and more.</description> <lastBuildDate>Fri, 10 Feb 2012 20:37:43 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Ken Mos</title><link>http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-174129</link> <dc:creator>Ken Mos</dc:creator> <pubDate>Mon, 19 Sep 2011 13:08:17 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-174129</guid> <description>Please update me with putty</description> <content:encoded><![CDATA[<p>Please update me with putty</p> ]]></content:encoded> </item> <item><title>By: Phissure</title><link>http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-173392</link> <dc:creator>Phissure</dc:creator> <pubDate>Thu, 18 Aug 2011 17:15:43 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-173392</guid> <description>I placed &quot;history -r&quot; in .bash_logout
I then added the following to .bashrc, just in case something did get written to .bash_history. It checks if you have any other sessions open, if you don&#039;t it clears the .bash_history file.
if [ w &#124; grep -c $(whoami) = 1 ]; then
&gt;/home/$(whoami)/.bash_history
fi</description> <content:encoded><![CDATA[<p>I placed &#8220;history -r&#8221; in .bash_logout</p><p>I then added the following to .bashrc, just in case something did get written to .bash_history. It checks if you have any other sessions open, if you don&#8217;t it clears the .bash_history file.</p><p>if [ w | grep -c $(whoami) = 1 ]; then<br
/> &gt;/home/$(whoami)/.bash_history<br
/> fi</p> ]]></content:encoded> </item> <item><title>By: Leila</title><link>http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-161572</link> <dc:creator>Leila</dc:creator> <pubDate>Mon, 29 Nov 2010 14:09:03 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-161572</guid> <description>gnudiego you are correct, it does not work with gnome-terminal which is installed as a default for linux mint. I am considering removing the gnome-terminal but would like to know what the best alternative would be.
Thanks.</description> <content:encoded><![CDATA[<p>gnudiego you are correct, it does not work with gnome-terminal which is installed as a default for linux mint. I am considering removing the gnome-terminal but would like to know what the best alternative would be.</p><p>Thanks.</p> ]]></content:encoded> </item> <item><title>By: gnudiego</title><link>http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-159467</link> <dc:creator>gnudiego</dc:creator> <pubDate>Tue, 07 Sep 2010 00:19:01 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-159467</guid> <description>It seems like .bash_logout doesn&#039;t work in psudo-terminals like gnome-terminal or konsole. Anybody has idea why it doesn&#039;t?</description> <content:encoded><![CDATA[<p>It seems like .bash_logout doesn&#8217;t work in psudo-terminals like gnome-terminal or konsole. Anybody has idea why it doesn&#8217;t?</p> ]]></content:encoded> </item> <item><title>By: Vinnie</title><link>http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-149498</link> <dc:creator>Vinnie</dc:creator> <pubDate>Wed, 15 Jul 2009 15:38:31 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-149498</guid> <description>Kumar asked about clearing the information from his putty window.
To do so -
1. Right click on the top bar of the putty window
2. A Context menu will appear
3. Select &quot;Clear Scrollback&quot;
This will erase all details of your session from putty&#039;s scrollback buffer.</description> <content:encoded><![CDATA[<p>Kumar asked about clearing the information from his putty window.</p><p>To do so -<br
/> 1. Right click on the top bar of the putty window<br
/> 2. A Context menu will appear<br
/> 3. Select &#8220;Clear Scrollback&#8221;</p><p>This will erase all details of your session from putty&#8217;s scrollback buffer.</p> ]]></content:encoded> </item> <item><title>By: Kumar Chetan Sharma</title><link>http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-145647</link> <dc:creator>Kumar Chetan Sharma</dc:creator> <pubDate>Thu, 20 Nov 2008 07:49:01 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-145647</guid> <description>even after running clear or history -c, which I find is the best option to add to ./bash_logout, I can still scroll my putty screen and see what all I have done. Is there any way to completely erase this information.</description> <content:encoded><![CDATA[<p>even after running clear or history -c, which I find is the best option to add to ./bash_logout, I can still scroll my putty screen and see what all I have done. Is there any way to completely erase this information.</p> ]]></content:encoded> </item> <item><title>By: erica</title><link>http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-144624</link> <dc:creator>erica</dc:creator> <pubDate>Mon, 11 Aug 2008 10:09:10 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-144624</guid> <description>you are a genius shafe</description> <content:encoded><![CDATA[<p>you are a genius shafe</p> ]]></content:encoded> </item> <item><title>By: Harka</title><link>http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-143865</link> <dc:creator>Harka</dc:creator> <pubDate>Fri, 23 May 2008 12:15:00 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-143865</guid> <description>Hi,
history -c will clear the entire bash history.
To only clear the current session history use:
history -r.</description> <content:encoded><![CDATA[<p>Hi,</p><p>history -c will clear the entire bash history.<br
/> To only clear the current session history use:<br
/> history -r.</p> ]]></content:encoded> </item> <item><title>By: Shankar</title><link>http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-143859</link> <dc:creator>Shankar</dc:creator> <pubDate>Fri, 23 May 2008 04:50:48 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-143859</guid> <description>Thanks shaff, It works</description> <content:encoded><![CDATA[<p>Thanks shaff, It works</p> ]]></content:encoded> </item> <item><title>By: SHAFE</title><link>http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-143358</link> <dc:creator>SHAFE</dc:creator> <pubDate>Wed, 02 Apr 2008 14:01:04 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-143358</guid> <description>This is the Wright and the Best OPtion to clear the command History
history -c</description> <content:encoded><![CDATA[<p>This is the Wright and the Best OPtion to clear the command History</p><p>history -c</p> ]]></content:encoded> </item> <item><title>By: jeff</title><link>http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-141221</link> <dc:creator>jeff</dc:creator> <pubDate>Thu, 27 Sep 2007 18:27:41 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-141221</guid> <description>ever heard of kill -9 $$ ?
It logs you out and clear the history.
It seems to kill bash, echo $$ gives you the bash PID
A friend of mine showed me this once, but I never completely get how it works, if someone can explain, please do so...</description> <content:encoded><![CDATA[<p>ever heard of kill -9 $$ ?</p><p>It logs you out and clear the history.</p><p>It seems to kill bash, echo $$ gives you the bash PID</p><p>A friend of mine showed me this once, but I never completely get how it works, if someone can explain, please do so&#8230;</p> ]]></content:encoded> </item> <item><title>By: NVRAM</title><link>http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-138439</link> <dc:creator>NVRAM</dc:creator> <pubDate>Thu, 24 May 2007 15:19:19 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-138439</guid> <description>&gt; maybe history -c is an option…
I like it.
I&#039;ve typically used:
HISTFILE=/do/not/use/$RANDOM/$RANDOM
&gt; why not put “unset HISTFILE” in your .bashrc file, since .bash_logout
&gt; will be run about the time .bash_history is written &lt;i&gt;[snip]&lt;/i&gt;
Similar idea, but IIRC I&#039;ve had problems with unsetting the HISTFILE -- but that was probably ~15 years ago under Korn shell.
I also tried a touch-then-delete approach in my profile, I think that one worked fine, but the $RANDOM is my default.
Incidentally, I try to always do this for &lt;b&gt;root&lt;/b&gt;, since on rare occasions passwords are on the command line.</description> <content:encoded><![CDATA[<p>&gt; maybe history -c is an option…<br
/> I like it.</p><p>I&#8217;ve typically used:<br
/> HISTFILE=/do/not/use/$RANDOM/$RANDOM</p><p>&gt; why not put “unset HISTFILE” in your .bashrc file, since .bash_logout<br
/> &gt; will be run about the time .bash_history is written <i>[snip]</i></p><p>Similar idea, but IIRC I&#8217;ve had problems with unsetting the HISTFILE &#8212; but that was probably ~15 years ago under Korn shell.</p><p>I also tried a touch-then-delete approach in my profile, I think that one worked fine, but the $RANDOM is my default.</p><p>Incidentally, I try to always do this for <b>root</b>, since on rare occasions passwords are on the command line.</p> ]]></content:encoded> </item> <item><title>By: naveenvasireddy</title><link>http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-138074</link> <dc:creator>naveenvasireddy</dc:creator> <pubDate>Mon, 21 May 2007 04:56:39 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-138074</guid> <description>really this is very useful for me</description> <content:encoded><![CDATA[<p>really this is very useful for me</p> ]]></content:encoded> </item> <item><title>By: vivek</title><link>http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-137997</link> <dc:creator>vivek</dc:creator> <pubDate>Wed, 16 May 2007 09:40:33 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-137997</guid> <description>&gt;&lt;em&gt;ln -s /dev/null .bash_history&lt;/em&gt;
sounds good idea
&gt;&lt;em&gt;maybe history -c is an option…&lt;/em&gt;
never thought of that, good idea :)
Appreciate your posts!</description> <content:encoded><![CDATA[<p>&gt;<em>ln -s /dev/null .bash_history</em><br
/> sounds good idea</p><p>&gt;<em>maybe history -c is an option…</em><br
/> never thought of that, good idea :)</p><p>Appreciate your posts!</p> ]]></content:encoded> </item> <item><title>By: J</title><link>http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-137989</link> <dc:creator>J</dc:creator> <pubDate>Wed, 16 May 2007 08:40:38 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-137989</guid> <description>maybe history -c is an option...</description> <content:encoded><![CDATA[<p>maybe history -c is an option&#8230;</p> ]]></content:encoded> </item> <item><title>By: dbr</title><link>http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-137976</link> <dc:creator>dbr</dc:creator> <pubDate>Tue, 15 May 2007 22:12:43 +0000</pubDate> <guid
isPermaLink="false">http://www.cyberciti.biz/tips/howto-clear-screen-when-you-logout.html#comment-137976</guid> <description>The &gt;~/.bash_history thing seems a slightly odd way of doing things, why not put &quot;unset HISTFILE&quot; in your .bashrc file, since .bash_logout will be run about the time .bash_history is written, so it may (though probably not) end up wiping the file before it&#039;s written.
Or what I prefer to do, rm .bash_history and then :
ln -s /dev/null .bash_history</description> <content:encoded><![CDATA[<p>The &gt;~/.bash_history thing seems a slightly odd way of doing things, why not put &#8220;unset HISTFILE&#8221; in your .bashrc file, since .bash_logout will be run about the time .bash_history is written, so it may (though probably not) end up wiping the file before it&#8217;s written.<br
/> Or what I prefer to do, rm .bash_history and then :<br
/> ln -s /dev/null .bash_history</p> ]]></content:encoded> </item> </channel> </rss>
