Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Distributions > Zenwalk
User Name
Zenwalk This forum is for the discussion of Zenwalk Linux.


  Search this Thread
Old 04-05-2007, 04:37 AM   #1
LQ Newbie
Registered: Mar 2006
Posts: 12

Rep: Reputation: 0
Smile Why doesn't removing .bash_history get rid of history?

This must be an incredibly simple question. I'm logged in as root.

root[~]# cd ~
root[~]# pwd
root[~]# history -c
root[~]# touch a 
root[~]# touch b
root[~]# touch c
root[~]# rm .bash_history
rm: cannot remove `.bash_history': No such file or directory
root[~]# history
    1  touch a 
    2  touch b
    3  touch c
    4  rm .bash_history
    5  history
Where is the history being stored? I usually disable history by symbolic linking it to /dev/null but that only works if you know where this history file is

Here's what I'm running (Zenwalk 4.4)
root[~]# grep root /etc/passwd
root[~]# /bin/sh -version
GNU bash, version 3.1.17(2)-release (i486-slackware-linux-gnu)

Last edited by dggoldst; 04-05-2007 at 04:41 AM.
Old 04-05-2007, 05:20 AM   #2
Registered: Jan 2005
Location: Atlanta, GA
Distribution: Gentoo, Slackware
Posts: 217

Rep: Reputation: 30
The history is not dumped to file until after bash exits; until then, it's in memory. You can disable the history dumping to file with the HISTFILE environment variable. From the bash man page:
              The name of the file in which command history is saved (see HISTORY below).  The default value  is  ~/.bash_his-
              tory.  If unset, the command history is not saved when an interactive shell exits.
There are actually a lot of ways to customize the history: how many lines are saved, where they are saved, which commands to ignore, etc.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Write history to .bash_history on reboot Kvetch Linux - Software 2 03-14-2007 09:43 PM
.bash_history t3gah Linux - Software 2 05-05-2005 04:45 AM
removing only most previously executed command from history? jagroop mand Linux - Newbie 2 01-19-2005 06:39 AM
bash_history linj Linux - Software 6 08-08-2003 11:13 AM
.bash_history gone togeno Linux - Security 3 06-30-2003 08:10 AM > Forums > Linux Forums > Linux - Distributions > Zenwalk

All times are GMT -5. The time now is 03:30 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration