Tagged: history size change permanently
- This topic has 10 replies, 4 voices, and was last updated Dec 29-12:30 am by iznit.
-
AuthorPosts
-
December 24, 2022 at 6:09 am #96099Member
eyekay234
When i enter the command echo $HISTSIZE i get a size limit of 500 . i tried using HISTSIZE=10000
and then checked with the echo command and saw it was now at 10,000 but as soon as i reboot, it goes back to default 500.How can i get the history to permanently be at 10,000
December 24, 2022 at 8:27 am #96103Member
sybok
::Hi, please provide more information:
1) How did you re-set HISTSIZE?
Perhaps, search internet for “permanent” change of HISTSIZE.
The change in terminal is for the current session only, change in configuration files is expected to be preserved.
Also, there is a related parameter, see e.g. https://askubuntu.com/questions/307541/how-to-change-history-size-for-ever
2) [If still relevant] What is your system. If live USB without persistence, then the changes are most likely not preserved.December 24, 2022 at 10:35 am #96107Member
eyekay234
::These are what i did:
sudo nano ~/.bashrc file
HISTSIZE=10000
echo $HISTSIZE
echo $HISTFILEi also did try what is on this https://askubuntu.com/questions/307541/how-to-change-history-size-for-ever but it didnt work as soon as i reboot, back to 500
As regards (3). this is not a live usb but an already installed system.
i just need a way to ensure that the changes made are permanent as regards the history being 10,000
December 24, 2022 at 4:25 pm #96123Moderator
Brian Masinick
::As long as your bashrc configuration file is executed when you open your bash shell, you can manually verify it with the echo command and if you really want to see it just add the echo command to the bashrc file just below the command that sets the value and you can display the value every time the file is sourced (run).
--
Brian MasinickDecember 26, 2022 at 7:55 am #96168Member
sybok
::I implicitly assume that you use BASH as your shell.
If ‘~/.bashrc’ does not work (which I find surprising, I admit I am not sure if one needs to export the variable), then you may try to put the HISTSIZE (and probably also HISTFILESIZE) into:
1) ‘~/.bash_profile’ if it exists (not on my current system)
2) If it does not, then use the file ‘~/.profile’ which should be read in even by BASH.Hope that helps.
- This reply was modified 4 months, 1 week ago by sybok.
December 26, 2022 at 4:03 pm #96181Moderator
Brian Masinick
::Personally I also export the history variables that I set; that makes them available for any later programs that are started from the shell.
--
Brian MasinickDecember 26, 2022 at 7:12 pm #96199Member
sybok
::According to the post https://www.antixforum.com/forums/topic/new-path-question/#post-96175 the file ‘~/.profile’ may not help but the 1st post in thread indicates that ‘~/.bashrc’ did work for PATH.
December 26, 2022 at 7:39 pm #96203Moderator
Brian Masinick
::export HISTSIZE=10000
export HISTFILESIZE=10000Put BOTH in /etc/bash.bashrc and all bash shells will include these unless they are overridden by your own definitions.
--
Brian MasinickDecember 27, 2022 at 4:02 am #96223Member
eyekay234
::@masinick FINALLY GOT IT TO WORK!!!
Put BOTH in /etc/bash.bashrc
export HISTSIZE=10000
export HISTFILESIZE=10000Then i ran HISTSIZE=10000
now when i run echo $HISTSIZE even after rebooting, it gives me 10,000.
Thanks a lot for the help
December 27, 2022 at 4:39 pm #96260Moderator
Brian Masinick
December 29, 2022 at 12:30 am #96338Member
iznit
::Personally I also export the history variables that I set; that makes them available for any later programs that are started from the shell.
Brian Masinick, thank you that’s a great tip.
-
AuthorPosts
- You must be logged in to reply to this topic.