increasing history size to 10000

Forum Forums General Software increasing history size to 10000

  • This topic has 10 replies, 4 voices, and was last updated Dec 29-12:30 am by iznit.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #96099
    Member
    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

      #96103
      Member
      sybok
        Helpful
        Up
        0
        ::

        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.

        #96107
        Member
        eyekay234
          Helpful
          Up
          0
          ::

          These are what i did:

          sudo nano ~/.bashrc file
          HISTSIZE=10000
          echo $HISTSIZE
          echo $HISTFILE

          i 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

          #96123
          Moderator
          Brian Masinick
            Helpful
            Up
            0
            ::

            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 Masinick

            #96168
            Member
            sybok
              Helpful
              Up
              0
              ::

              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, 2 weeks ago by sybok.
              #96181
              Moderator
              Brian Masinick
                Helpful
                Up
                0
                ::

                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

                #96199
                Member
                sybok
                  Helpful
                  Up
                  0
                  ::

                  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.

                  #96203
                  Moderator
                  Brian Masinick
                    Helpful
                    Up
                    1
                    ::

                    export HISTSIZE=10000
                    export HISTFILESIZE=10000

                    Put BOTH in /etc/bash.bashrc and all bash shells will include these unless they are overridden by your own definitions.

                    --
                    Brian Masinick

                    #96223
                    Member
                    eyekay234
                      Helpful
                      Up
                      1
                      ::

                      @masinick FINALLY GOT IT TO WORK!!!

                      Put BOTH in /etc/bash.bashrc

                      export HISTSIZE=10000
                      export HISTFILESIZE=10000

                      Then i ran HISTSIZE=10000

                      now when i run echo $HISTSIZE even after rebooting, it gives me 10,000.

                      Thanks a lot for the help

                      #96260
                      Moderator
                      Brian Masinick
                        Helpful
                        Up
                        0
                        ::

                        Great!

                        I’m happy that it works.

                        --
                        Brian Masinick

                        #96338
                        Member
                        iznit
                          Helpful
                          Up
                          0
                          ::

                          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.

                        Viewing 11 posts - 1 through 11 (of 11 total)
                        • You must be logged in to reply to this topic.