Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

How do I change my history size?

How does a guy change his history size? By default there's 1000 lines. I want to go back and review my history for scripting later so I can be more productive. Here's the problem I'm running into. Every tutorial or article I find about this seems to be written by someone who has no idea what they are doing?

What files do I need to edit? Variables to change? stuff to comment out?

From what I could find the file I'm supposed to edit is bash.bashrc. If I make changes to it, it does nothing. There are a few articles that say I'm supposed to edit environment. This is something that really seems like it should be easy to do. 🤝
Are you working directly from the command line or connecting in with putty over ssh?


See here if on cli http://stackoverflow.com/questions/94572...sh-history

If it's putty it's under the session settings I can't remember off the top of my head but I can look if you need it, I use it daily but I have it set globally now.


Final point, it's .bashrc in your home directory, not bash.bashrc
It's still clear as mud. When I edit /etc/bash.bashrc it does nothing for me. Is there another file I'm supposed to edit?
Edit /home/yourusername/.bashrc or /etc/.bashrc

Note the lack of the bash before the . This is not a typo.
There's nothing like that in my home folder. Is it in /Home/usr/ ? /usr/share/
(Feb 26, 2015 12:02 PM)u534D Wrote:  There's nothing like that in my home folder. Is it in /Home/usr/ ? /usr/share/
Yes there is
PHP Code

<?php 
ls 
-al | grep .bash 
It is a hidden file.
XMPP: pm me
(Feb 26, 2015 02:21 PM)Betty Blue Wrote:  Yes there is
PHP Code

<?php 
ls 
-al | grep .bash 
It is a hidden file.

Cool. I found it with:
Code
ls -al | grep .bash

Then I opened with
Code
gedit .bashrc

Am I to understand that changing these two lines will give me unlimitted history?
Change this:
Quote:HISTSIZE=1000
HISTFILESIZE=1000


To this:
Quote:HISTSIZE=
HISTFILESIZE=


Or is there something else I have to do?
(Feb 26, 2015 05:11 PM)u534D Wrote:  Cool. I found it with:
Code
ls -al | grep .bash

Then I opened with
Code
gedit .bashrc

Am I to understand that changing these two lines will give me unlimitted history?
Change this:

To this:

Or is there something else I have to do?
That should do it, you can either do that or set it to some high number.
XMPP: pm me
Totally worked!

If I run
Code
echo $HISTSIZE
I get a blank output and that's exactly what I need.
This may default to a system wide history limit from the global bashrc. Setting it to -1 will force it to be unlimited.

It may be fine now though now and you can ignore the above :)
Good to know. I always forget about -1.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by Tex.Apr 21, 2016 02:25 PM 3 98 Apr 21, 2016 02:25 PM
Last Post: FreakyFreak