LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Zenwalk
User Name
Password
Zenwalk This forum is for the discussion of Zenwalk Linux.

Notices

Reply
 
Search this Thread
Old 04-05-2007, 03:37 AM   #1
dggoldst
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.

Code:
root[~]# cd ~
root[~]# pwd
/root
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)
Code:
root[~]# grep root /etc/passwd
root:x:0:0::/root:/bin/bash
root[~]# /bin/sh -version
GNU bash, version 3.1.17(2)-release (i486-slackware-linux-gnu)

Last edited by dggoldst; 04-05-2007 at 03:41 AM.
 
Old 04-05-2007, 04:20 AM   #2
puffinman
Member
 
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:
Code:
       HISTFILE
              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.
 
  


Reply


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 08:43 PM
.bash_history t3gah Linux - Software 2 05-05-2005 03:45 AM
removing only most previously executed command from history? jagroop mand Linux - Newbie 2 01-19-2005 05:39 AM
bash_history linj Linux - Software 6 08-08-2003 10:13 AM
.bash_history gone togeno Linux - Security 3 06-30-2003 07:10 AM


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

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