howto clear bash history?

Alexey Fadyushin fab at s-tunnel.com
Mon Jan 31 14:32:31 UTC 2005


Another way to clear history is to delete .bash_history file.
rm -f ~/.bash_history

However, actions on .bash_history will not clear the history of commands 
used in the bash session running at that time. That history is stored in 
RAM and written to .bash_history when the session ends. The correct way 
to clear history is to use 'history -c' because this will clear all 
history, including commands used in the session from which the command 
'history -c' is given.

Alexey Fadyushin.
Brainbench MVP for Linux.
http://www.brainbench.com

Manuel Arostegui Ramirez wrote:
> El Lunes 31 Enero 2005 06:53, Aseem Khurana escribió:
> 
>>Anyone with hints to clear bash history?
>>
>>--
>>No virus found in this outgoing message.
>>Checked by AVG Anti-Virus.
>>Version: 7.0.300 / Virus Database: 265.8.2 - Release Date: 1/28/2005
> 
> 
> I've read what Ed and Michael said, whatever, here is another way to clear 
> your bash history: [linux]$  > .bash_history
> 
> Cheers
> 
> 




More information about the redhat-list mailing list