LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Is it possible to make history file unlimited? (https://www.linuxquestions.org/questions/linux-general-1/is-it-possible-to-make-history-file-unlimited-4175438051/)

penguinator 11-20-2012 08:53 PM

Is it possible to make history file unlimited?
 
hello all,

I did a google search but there is no mention of making the history file unlimited. For now, I have set it to 3000. But, I don't want a limit on the history file, I want it to continue on and on until I clear it myself. Is it possible.

btmiller 11-21-2012 01:02 AM

According to some googling, unsetting the HISTSIZE and HISTFILESIZE environment variables should do what you want it to do. Oddly, the bash man page mentions unsetting HISTFILESIZE, but doesn't say anything about unsetting HISTSIZE.

penguinator 11-21-2012 01:51 AM

The only variables I have for history in my /etc/profile are

HISTCONTROL=ignoredups
HISTSIZE=3000

I am going to make HISTSIZE=3000 into HISTSIZE= and see what happens. Thank you for replying

Habitual 11-21-2012 01:34 PM

Code:

HISTCONTROL=ignoredups:erasedups
HISTSIZE=300000
HISTFILESIZE=300000
export HISTTIMEFORMAT='%F %T '

and I get
Code:

-rw-r--r-- 1 jj users 272K Nov 21 2012  1:50 PM .bash_history
6875 commands in bash_history, so far.

Yes, I timestamp my history. :)

penguinator 11-21-2012 02:40 PM

Just edited my /etc/profile with your suggested codes. Thanks Habitual

Habitual 11-21-2012 05:25 PM

You're quite Welcome.

It should be noted that if/when you turn 'on'
HISTTIMEFORMAT, all your previous history will have the same timestamp, after that, it behaves as one expects.

In Summary:
HISTTIMEFORMAT stamps forward

I don't know how those entries will behave in a .profile, I've always used .bashrc

Good luck.


All times are GMT -5. The time now is 07:54 AM.