LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-27-2005, 11:32 AM   #1
hussar
Member
 
Registered: Oct 2003
Location: Heidelberg, Germany
Distribution: Slackware 11.0; Kubuntu 6.06; OpenBSD 4.0; OS X 10.4.10
Posts: 345

Rep: Reputation: 30
History marches on -Why?


When I do something like `history | grep somepastcmdofinterest`, my history list is up to 962 lines. When I issue the command `echo $HISTFILESIZE`, I get 500.

Any thoughts on why my history file could be growing to these proportions and how I could get it to pay attention to the $HISTFILESIZE variable? Also, I seem to remember reading somewhere that you can get history to ignore duplicates, that is, commands that have been entered repeatedly. How do you do that?
 
Old 11-27-2005, 11:44 AM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
For the duplicate commands I believe you can add :
Code:
export HISTCONTROL=ignoredups
... somewhere in your bashrc or similar

For the size of .bash_history, I don't know, are the 900 lines filled with only commands,
no timestamp ?

[edit]
From man bash :
Code:
HISTFILESIZE
              The maximum number of lines contained in the history file.  When
              this  variable  is  assigned  a value, the history file is trun-
              cated, if necessary, to contain no  more  than  that  number  of
              lines.   The  default  value  is  500.  The history file is also
              truncated to this size after  writing  it  when  an  interactive
              shell exits.
So you have to exit the shell for the history file be trucated to 500 lines

Last edited by keefaz; 11-27-2005 at 11:52 AM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
history junaid18183 Linux - General 14 11-07-2009 07:01 AM
history saipraveen Linux - Newbie 5 06-10-2005 07:04 PM
about history jackandking Programming 1 12-18-2004 02:10 PM
How to find back "history" database after "history -c" ? san_lss Linux - Newbie 1 01-07-2004 11:53 AM
History neohybrid1 Linux - General 1 12-03-2002 04:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:58 AM.

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