Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've tried reading man pages and googling to answer this and ended up wanting to kill myself. Trying to do things on Linux (in this case, Ubuntu) makes me feel that way every day.
So, my question: how do I change the size of my .bash_history file? I just want it to store 20000 lines instead of the default 500. And - do profiles affect in any way the way command history behaves?
HISTFILESIZE
The maximum number of lines contained in the history file. When this variable is assigned a value, the history file is truncated, if necessary, by removing the oldest entries, 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.
That is a variable you set at command line or can add to your bash_profile or .bashrc
e.g.
export HISTFILESIZE=1000
Last edited by MensaWater; 08-04-2009 at 09:45 AM.
Reason: mistyped HISTFILESIZE as HISTFILE as pointed out by Jay73
to ~/.bashrc ?
Or run 'export HISTFILE=1000' (or 'export HISTFILESIZE=1000') from a terminal, assuming it will change the setting permanently?
And how do Terminal profiles interact with history? Do they all share the same .bash_history file, or is there a separate one for each profile? I'm launching my terminal as follows: gnome-terminal --window-with-profile=c --geometry=170x50.
(I actually had to guess and experiment with '--geometry' because all the gnome-terminal manpage had to say on this option was a paraphrase on "go search....".)
Thanks, and sorry about being so dramatic before.
It's my frustration speaking, not me....
What I posted in my last post works on Ubuntu.
Bash will keep appending commands to ~/.bash_history until it reaches 20K lines, at which point for each new command added the oldest one at that moment will be removed.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.