LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-20-2012, 08:53 PM   #1
penguinator
LQ Newbie
 
Registered: Nov 2012
Posts: 24

Rep: Reputation: Disabled
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.

Last edited by penguinator; 11-20-2012 at 09:01 PM.
 
Old 11-21-2012, 01:02 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
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.
 
Old 11-21-2012, 01:51 AM   #3
penguinator
LQ Newbie
 
Registered: Nov 2012
Posts: 24

Original Poster
Rep: Reputation: Disabled
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
 
Old 11-21-2012, 01:34 PM   #4
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
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.
 
Old 11-21-2012, 02:40 PM   #5
penguinator
LQ Newbie
 
Registered: Nov 2012
Posts: 24

Original Poster
Rep: Reputation: Disabled
Just edited my /etc/profile with your suggested codes. Thanks Habitual
 
Old 11-21-2012, 05:25 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
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.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
detect file deletion on an operating system and trace the file history or activity? lovsis Linux - Security 2 10-19-2010 08:52 AM
Any log file for checking file permission change history in RHEL 5.1? bilalcochin Linux - Newbie 3 04-02-2010 09:57 AM
core dump file size exceeds limit with ulimit -f unlimited. initpidzero Linux - Software 0 07-28-2009 02:08 AM
tcsh: can you save the history from multiple shells to one history file? BrianK General 2 04-23-2009 05:19 AM
LXer: Dell and Linux Make History LXer Syndicated Linux News 0 03-26-2007 02:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:31 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration