Increase reverse-i-search history length

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite












Is there a way to increase the default amount of history reverse-i-search (CTRL+R) keeps? In Ubuntu 16.04, it doesn't seem to have a very long "memory", sometimes even commands from yesterday are already gone from its history, ie. will not appear even after cycling through all entries with repeated CTRL+R.



I'm using Terminator as the console.










share|improve this question

























    up vote
    1
    down vote

    favorite












    Is there a way to increase the default amount of history reverse-i-search (CTRL+R) keeps? In Ubuntu 16.04, it doesn't seem to have a very long "memory", sometimes even commands from yesterday are already gone from its history, ie. will not appear even after cycling through all entries with repeated CTRL+R.



    I'm using Terminator as the console.










    share|improve this question























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      Is there a way to increase the default amount of history reverse-i-search (CTRL+R) keeps? In Ubuntu 16.04, it doesn't seem to have a very long "memory", sometimes even commands from yesterday are already gone from its history, ie. will not appear even after cycling through all entries with repeated CTRL+R.



      I'm using Terminator as the console.










      share|improve this question













      Is there a way to increase the default amount of history reverse-i-search (CTRL+R) keeps? In Ubuntu 16.04, it doesn't seem to have a very long "memory", sometimes even commands from yesterday are already gone from its history, ie. will not appear even after cycling through all entries with repeated CTRL+R.



      I'm using Terminator as the console.







      command-line search terminator






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 14 at 9:26









      Juha Untinen

      1135




      1135




















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted












          The size of the history is specified with the two variables HISTSIZE (history of a single terminal session, saved in RAM) and HISTFILESIZE (size of the history file, usually ~/.bash_history). This size is set in number of lines in your ~/.bashrc file, e.g.:



          HISTSIZE=1000
          HISTFILESIZE=10000


          This saves 1000 lines (= commands) per terminal session and 10000 in the history file.



          The reverse-i-search searches the history of the current session as well as the history file, but it can't include commands from other sessions that are still opened.



          Further reading:



          • How to change history size for ever?

          • How do I search my command-line history for commands I used before?

          • How do I access my Bash History?





          share|improve this answer






















          • Thanks, this solves the issue and you had the first answer.
            – Juha Untinen
            Feb 14 at 9:50

















          up vote
          3
          down vote













          It is really easy, just change your HISTSIZE and HISTFILESIZE variables in you .bashrc



          HISTSIZE=-1
          HISTFILESIZE=-1


          In bash 4.3 and later you can also use HISTSIZE=-1 HISTFILESIZE=-1 to set it to be unlimited.



          Consider that HISTSIZE is the number of lines or commands that are stored in memory in a history list while your bash session is ongoing.



          HISTFILESIZE is the number of lines or commands that (a) are allowed in the history file at startup time of a session, and (b) are stored in the history file at the end of your bash session for use in future sessions.



          Take a look at this link



          Regards,






          share|improve this answer



























            up vote
            2
            down vote













            There is no time limit but rather a line or size limit on the history of the commandline.



            You can modify that in your ~/.bashrc



            export HISTSIZE=500000
            export HISTFILESIZE=500000


            Would mean a "memory" of 500.000 lines in your history, both currently (HISTSIZE) and written to your history file (HISTFILESIZE).



            However, keep in mind that the file is only written when you exit a terminal.



            You can reverse-i-search your commands in the same terminal, before the history is written to the history file, but cannot find your commands in any new terminals before you have not exited the original one!






            share|improve this answer




















            • the file is only written when you exit a terminal. Ah, I think that explains it. I generally leave it "running" with the host OS (virtualbox) in hibernation. In my .bashrc there was HISTSIZE=1000 and HISTFILESIZE=2000 from some team template.
              – Juha Untinen
              Feb 14 at 9:48







            • 1




              history -a writes it "on demand", if you need it
              – Robert Riedl
              Feb 14 at 9:51










            • There is also a hacky solution to write history immediately, with PROMPT_COMMAND="history -a" in the .bashrc described here. Although I'm not sure I can recommend that... what I would recommend is setting a HISTTIMEFORMAT like this export HISTTIMEFORMAT='[%Y.%m.%d %H:%M:%S] ' so you see exactly when you executed the command
              – Robert Riedl
              Feb 14 at 9:56










            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "89"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1006075%2fincrease-reverse-i-search-history-length%23new-answer', 'question_page');

            );

            Post as a guest






























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote



            accepted












            The size of the history is specified with the two variables HISTSIZE (history of a single terminal session, saved in RAM) and HISTFILESIZE (size of the history file, usually ~/.bash_history). This size is set in number of lines in your ~/.bashrc file, e.g.:



            HISTSIZE=1000
            HISTFILESIZE=10000


            This saves 1000 lines (= commands) per terminal session and 10000 in the history file.



            The reverse-i-search searches the history of the current session as well as the history file, but it can't include commands from other sessions that are still opened.



            Further reading:



            • How to change history size for ever?

            • How do I search my command-line history for commands I used before?

            • How do I access my Bash History?





            share|improve this answer






















            • Thanks, this solves the issue and you had the first answer.
              – Juha Untinen
              Feb 14 at 9:50














            up vote
            1
            down vote



            accepted












            The size of the history is specified with the two variables HISTSIZE (history of a single terminal session, saved in RAM) and HISTFILESIZE (size of the history file, usually ~/.bash_history). This size is set in number of lines in your ~/.bashrc file, e.g.:



            HISTSIZE=1000
            HISTFILESIZE=10000


            This saves 1000 lines (= commands) per terminal session and 10000 in the history file.



            The reverse-i-search searches the history of the current session as well as the history file, but it can't include commands from other sessions that are still opened.



            Further reading:



            • How to change history size for ever?

            • How do I search my command-line history for commands I used before?

            • How do I access my Bash History?





            share|improve this answer






















            • Thanks, this solves the issue and you had the first answer.
              – Juha Untinen
              Feb 14 at 9:50












            up vote
            1
            down vote



            accepted







            up vote
            1
            down vote



            accepted








            The size of the history is specified with the two variables HISTSIZE (history of a single terminal session, saved in RAM) and HISTFILESIZE (size of the history file, usually ~/.bash_history). This size is set in number of lines in your ~/.bashrc file, e.g.:



            HISTSIZE=1000
            HISTFILESIZE=10000


            This saves 1000 lines (= commands) per terminal session and 10000 in the history file.



            The reverse-i-search searches the history of the current session as well as the history file, but it can't include commands from other sessions that are still opened.



            Further reading:



            • How to change history size for ever?

            • How do I search my command-line history for commands I used before?

            • How do I access my Bash History?





            share|improve this answer
















            The size of the history is specified with the two variables HISTSIZE (history of a single terminal session, saved in RAM) and HISTFILESIZE (size of the history file, usually ~/.bash_history). This size is set in number of lines in your ~/.bashrc file, e.g.:



            HISTSIZE=1000
            HISTFILESIZE=10000


            This saves 1000 lines (= commands) per terminal session and 10000 in the history file.



            The reverse-i-search searches the history of the current session as well as the history file, but it can't include commands from other sessions that are still opened.



            Further reading:



            • How to change history size for ever?

            • How do I search my command-line history for commands I used before?

            • How do I access my Bash History?






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Feb 14 at 9:46

























            answered Feb 14 at 9:40









            dessert

            20k55795




            20k55795











            • Thanks, this solves the issue and you had the first answer.
              – Juha Untinen
              Feb 14 at 9:50
















            • Thanks, this solves the issue and you had the first answer.
              – Juha Untinen
              Feb 14 at 9:50















            Thanks, this solves the issue and you had the first answer.
            – Juha Untinen
            Feb 14 at 9:50




            Thanks, this solves the issue and you had the first answer.
            – Juha Untinen
            Feb 14 at 9:50












            up vote
            3
            down vote













            It is really easy, just change your HISTSIZE and HISTFILESIZE variables in you .bashrc



            HISTSIZE=-1
            HISTFILESIZE=-1


            In bash 4.3 and later you can also use HISTSIZE=-1 HISTFILESIZE=-1 to set it to be unlimited.



            Consider that HISTSIZE is the number of lines or commands that are stored in memory in a history list while your bash session is ongoing.



            HISTFILESIZE is the number of lines or commands that (a) are allowed in the history file at startup time of a session, and (b) are stored in the history file at the end of your bash session for use in future sessions.



            Take a look at this link



            Regards,






            share|improve this answer
























              up vote
              3
              down vote













              It is really easy, just change your HISTSIZE and HISTFILESIZE variables in you .bashrc



              HISTSIZE=-1
              HISTFILESIZE=-1


              In bash 4.3 and later you can also use HISTSIZE=-1 HISTFILESIZE=-1 to set it to be unlimited.



              Consider that HISTSIZE is the number of lines or commands that are stored in memory in a history list while your bash session is ongoing.



              HISTFILESIZE is the number of lines or commands that (a) are allowed in the history file at startup time of a session, and (b) are stored in the history file at the end of your bash session for use in future sessions.



              Take a look at this link



              Regards,






              share|improve this answer






















                up vote
                3
                down vote










                up vote
                3
                down vote









                It is really easy, just change your HISTSIZE and HISTFILESIZE variables in you .bashrc



                HISTSIZE=-1
                HISTFILESIZE=-1


                In bash 4.3 and later you can also use HISTSIZE=-1 HISTFILESIZE=-1 to set it to be unlimited.



                Consider that HISTSIZE is the number of lines or commands that are stored in memory in a history list while your bash session is ongoing.



                HISTFILESIZE is the number of lines or commands that (a) are allowed in the history file at startup time of a session, and (b) are stored in the history file at the end of your bash session for use in future sessions.



                Take a look at this link



                Regards,






                share|improve this answer












                It is really easy, just change your HISTSIZE and HISTFILESIZE variables in you .bashrc



                HISTSIZE=-1
                HISTFILESIZE=-1


                In bash 4.3 and later you can also use HISTSIZE=-1 HISTFILESIZE=-1 to set it to be unlimited.



                Consider that HISTSIZE is the number of lines or commands that are stored in memory in a history list while your bash session is ongoing.



                HISTFILESIZE is the number of lines or commands that (a) are allowed in the history file at startup time of a session, and (b) are stored in the history file at the end of your bash session for use in future sessions.



                Take a look at this link



                Regards,







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 14 at 9:44









                Alvaro Niño

                2337




                2337




















                    up vote
                    2
                    down vote













                    There is no time limit but rather a line or size limit on the history of the commandline.



                    You can modify that in your ~/.bashrc



                    export HISTSIZE=500000
                    export HISTFILESIZE=500000


                    Would mean a "memory" of 500.000 lines in your history, both currently (HISTSIZE) and written to your history file (HISTFILESIZE).



                    However, keep in mind that the file is only written when you exit a terminal.



                    You can reverse-i-search your commands in the same terminal, before the history is written to the history file, but cannot find your commands in any new terminals before you have not exited the original one!






                    share|improve this answer




















                    • the file is only written when you exit a terminal. Ah, I think that explains it. I generally leave it "running" with the host OS (virtualbox) in hibernation. In my .bashrc there was HISTSIZE=1000 and HISTFILESIZE=2000 from some team template.
                      – Juha Untinen
                      Feb 14 at 9:48







                    • 1




                      history -a writes it "on demand", if you need it
                      – Robert Riedl
                      Feb 14 at 9:51










                    • There is also a hacky solution to write history immediately, with PROMPT_COMMAND="history -a" in the .bashrc described here. Although I'm not sure I can recommend that... what I would recommend is setting a HISTTIMEFORMAT like this export HISTTIMEFORMAT='[%Y.%m.%d %H:%M:%S] ' so you see exactly when you executed the command
                      – Robert Riedl
                      Feb 14 at 9:56














                    up vote
                    2
                    down vote













                    There is no time limit but rather a line or size limit on the history of the commandline.



                    You can modify that in your ~/.bashrc



                    export HISTSIZE=500000
                    export HISTFILESIZE=500000


                    Would mean a "memory" of 500.000 lines in your history, both currently (HISTSIZE) and written to your history file (HISTFILESIZE).



                    However, keep in mind that the file is only written when you exit a terminal.



                    You can reverse-i-search your commands in the same terminal, before the history is written to the history file, but cannot find your commands in any new terminals before you have not exited the original one!






                    share|improve this answer




















                    • the file is only written when you exit a terminal. Ah, I think that explains it. I generally leave it "running" with the host OS (virtualbox) in hibernation. In my .bashrc there was HISTSIZE=1000 and HISTFILESIZE=2000 from some team template.
                      – Juha Untinen
                      Feb 14 at 9:48







                    • 1




                      history -a writes it "on demand", if you need it
                      – Robert Riedl
                      Feb 14 at 9:51










                    • There is also a hacky solution to write history immediately, with PROMPT_COMMAND="history -a" in the .bashrc described here. Although I'm not sure I can recommend that... what I would recommend is setting a HISTTIMEFORMAT like this export HISTTIMEFORMAT='[%Y.%m.%d %H:%M:%S] ' so you see exactly when you executed the command
                      – Robert Riedl
                      Feb 14 at 9:56












                    up vote
                    2
                    down vote










                    up vote
                    2
                    down vote









                    There is no time limit but rather a line or size limit on the history of the commandline.



                    You can modify that in your ~/.bashrc



                    export HISTSIZE=500000
                    export HISTFILESIZE=500000


                    Would mean a "memory" of 500.000 lines in your history, both currently (HISTSIZE) and written to your history file (HISTFILESIZE).



                    However, keep in mind that the file is only written when you exit a terminal.



                    You can reverse-i-search your commands in the same terminal, before the history is written to the history file, but cannot find your commands in any new terminals before you have not exited the original one!






                    share|improve this answer












                    There is no time limit but rather a line or size limit on the history of the commandline.



                    You can modify that in your ~/.bashrc



                    export HISTSIZE=500000
                    export HISTFILESIZE=500000


                    Would mean a "memory" of 500.000 lines in your history, both currently (HISTSIZE) and written to your history file (HISTFILESIZE).



                    However, keep in mind that the file is only written when you exit a terminal.



                    You can reverse-i-search your commands in the same terminal, before the history is written to the history file, but cannot find your commands in any new terminals before you have not exited the original one!







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Feb 14 at 9:43









                    Robert Riedl

                    2,740623




                    2,740623











                    • the file is only written when you exit a terminal. Ah, I think that explains it. I generally leave it "running" with the host OS (virtualbox) in hibernation. In my .bashrc there was HISTSIZE=1000 and HISTFILESIZE=2000 from some team template.
                      – Juha Untinen
                      Feb 14 at 9:48







                    • 1




                      history -a writes it "on demand", if you need it
                      – Robert Riedl
                      Feb 14 at 9:51










                    • There is also a hacky solution to write history immediately, with PROMPT_COMMAND="history -a" in the .bashrc described here. Although I'm not sure I can recommend that... what I would recommend is setting a HISTTIMEFORMAT like this export HISTTIMEFORMAT='[%Y.%m.%d %H:%M:%S] ' so you see exactly when you executed the command
                      – Robert Riedl
                      Feb 14 at 9:56
















                    • the file is only written when you exit a terminal. Ah, I think that explains it. I generally leave it "running" with the host OS (virtualbox) in hibernation. In my .bashrc there was HISTSIZE=1000 and HISTFILESIZE=2000 from some team template.
                      – Juha Untinen
                      Feb 14 at 9:48







                    • 1




                      history -a writes it "on demand", if you need it
                      – Robert Riedl
                      Feb 14 at 9:51










                    • There is also a hacky solution to write history immediately, with PROMPT_COMMAND="history -a" in the .bashrc described here. Although I'm not sure I can recommend that... what I would recommend is setting a HISTTIMEFORMAT like this export HISTTIMEFORMAT='[%Y.%m.%d %H:%M:%S] ' so you see exactly when you executed the command
                      – Robert Riedl
                      Feb 14 at 9:56















                    the file is only written when you exit a terminal. Ah, I think that explains it. I generally leave it "running" with the host OS (virtualbox) in hibernation. In my .bashrc there was HISTSIZE=1000 and HISTFILESIZE=2000 from some team template.
                    – Juha Untinen
                    Feb 14 at 9:48





                    the file is only written when you exit a terminal. Ah, I think that explains it. I generally leave it "running" with the host OS (virtualbox) in hibernation. In my .bashrc there was HISTSIZE=1000 and HISTFILESIZE=2000 from some team template.
                    – Juha Untinen
                    Feb 14 at 9:48





                    1




                    1




                    history -a writes it "on demand", if you need it
                    – Robert Riedl
                    Feb 14 at 9:51




                    history -a writes it "on demand", if you need it
                    – Robert Riedl
                    Feb 14 at 9:51












                    There is also a hacky solution to write history immediately, with PROMPT_COMMAND="history -a" in the .bashrc described here. Although I'm not sure I can recommend that... what I would recommend is setting a HISTTIMEFORMAT like this export HISTTIMEFORMAT='[%Y.%m.%d %H:%M:%S] ' so you see exactly when you executed the command
                    – Robert Riedl
                    Feb 14 at 9:56




                    There is also a hacky solution to write history immediately, with PROMPT_COMMAND="history -a" in the .bashrc described here. Although I'm not sure I can recommend that... what I would recommend is setting a HISTTIMEFORMAT like this export HISTTIMEFORMAT='[%Y.%m.%d %H:%M:%S] ' so you see exactly when you executed the command
                    – Robert Riedl
                    Feb 14 at 9:56

















                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1006075%2fincrease-reverse-i-search-history-length%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    pylint3 and pip3 broken

                    Missing snmpget and snmpwalk

                    How to enroll fingerprints to Ubuntu 17.10 with VFS491