Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 02 Jun 2007 14:28:48 -0400
From:      Kevin Hunter <hunteke@earlham.edu>
To:        sac <sac@inf.in>
Cc:        FreeBSD-Questions <freebsd-questions@freebsd.org>, VeeJay <maanjee@gmail.com>
Subject:   Re: How to disable command prompt history?
Message-ID:  <4661B6E0.803@earlham.edu>
In-Reply-To: <e14997e00706021056h2c94e1c6je3e57acc33841066@mail.gmail.com>
References:  <2cd0a0da0706020638g48b7ac7fn946c6e3caddc0663@mail.gmail.com>	<466199E5.3040005@vindaloo.com> <e14997e00706021056h2c94e1c6je3e57acc33841066@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
At 1:56p -0400 on 02 Jun 2007, sac wrote:
> On 6/2/07, Christopher Hilton <chris@vindaloo.com> wrote:
>> VeeJay wrote:
>>> Could someone would like to describe that how we can disable to show 
>>> last executed commands by pressing Up Arrow?
>>>
>> 
>> That would depend on which shell you are running. Can you run the 
>> following command and post the results here?
>> 
>>      echo $SHELL
> 
> By default most of the shells like bash, zsh, ksh have history option. 
> But you can avoid writing the history of the current session to the 
> history file by unsetting the HISTFILE environment variable.
> So next time when you login the history of the previous session will
> not be shown.

I'd be curious as to the underlying "why?".  Having a history of what
you've done is generally a Good Thing.  The only reason that I
personally have ever come across to necessitate not storing my actions
is when I'm playing a prank on one of my friends.  Other than that,
having the ability to go see what commands I was executing three years
ago comes in awful handy.  I /could/ recreate that arcane command
sequence for that one-off job I needed 1,237 days ago, or I could do a

history | grep 'substring I remember in command' | less

And, if you're worried about the space it takes to store the history,
don't.  It's extremely negligible.

Kevin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4661B6E0.803>