Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Clear the terminal's command history' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Clear the terminal's command history
Authored by: osxpounder on Mar 23, '04 05:38:12PM

I didn't have a .bash_profile, so I made one with only this line in it.

I don't notice any difference. I can quit & restart the Terminal, and still scroll back through weeks of my history.

I keep forgetting the way to check which shell I'm running, which might be the prob, for all I know. No, wait, I did a 'ps' and I see "-bash", so I'm using the same shell this hint's meant for.

Hmm.....

---
--
osxpounder



[ Reply to This | # ]
Clear the terminal's command history
Authored by: baddog on Mar 23, '04 06:22:49PM

To get it to work for you, you might need to log out and back in. bash_profile is only read at login time. Alternatively, you can put it in your ~/.bashrc file (read whenever a new shell is opened). It is redundant to set env variables everytime you start a new shell, but I do it often because it's convenient and guaranteed to work right away.

To make bash *erase* your history file every time you quit the shell, you should try this instead of unsetting HISTFILE:

export HISTFILESIZE=0



[ Reply to This | # ]
Clear the terminal's command history
Authored by: Adam Schenker on Mar 23, '04 07:36:02PM
Did you remove your old .bash_history file (rm ~/bash_history)? My suggestion will keep the history file from being created, but I don't think it will stop an already created history file from being used.

[ Reply to This | # ]