Increase reverse-i-search history length
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
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.
command-line search terminator
add a comment |Â
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.
command-line search terminator
add a comment |Â
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.
command-line search terminator
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
command-line search terminator
asked Feb 14 at 9:26
![](https://i.stack.imgur.com/NRLmh.jpg?s=32&g=1)
![](https://i.stack.imgur.com/NRLmh.jpg?s=32&g=1)
Juha Untinen
1135
1135
add a comment |Â
add a comment |Â
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?
Thanks, this solves the issue and you had the first answer.
â Juha Untinen
Feb 14 at 9:50
add a comment |Â
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,
add a comment |Â
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!
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, withPROMPT_COMMAND="history -a"
in the.bashrc
described here. Although I'm not sure I can recommend that... what I would recommend is setting aHISTTIMEFORMAT
like thisexport HISTTIMEFORMAT='[%Y.%m.%d %H:%M:%S] '
so you see exactly when you executed the command
â Robert Riedl
Feb 14 at 9:56
add a comment |Â
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?
Thanks, this solves the issue and you had the first answer.
â Juha Untinen
Feb 14 at 9:50
add a comment |Â
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?
Thanks, this solves the issue and you had the first answer.
â Juha Untinen
Feb 14 at 9:50
add a comment |Â
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?
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?
edited Feb 14 at 9:46
answered Feb 14 at 9:40
![](https://i.stack.imgur.com/9L8vd.png?s=32&g=1)
![](https://i.stack.imgur.com/9L8vd.png?s=32&g=1)
dessert
20k55795
20k55795
Thanks, this solves the issue and you had the first answer.
â Juha Untinen
Feb 14 at 9:50
add a comment |Â
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
add a comment |Â
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,
add a comment |Â
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,
add a comment |Â
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,
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,
answered Feb 14 at 9:44
Alvaro Niño
2337
2337
add a comment |Â
add a comment |Â
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!
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, withPROMPT_COMMAND="history -a"
in the.bashrc
described here. Although I'm not sure I can recommend that... what I would recommend is setting aHISTTIMEFORMAT
like thisexport HISTTIMEFORMAT='[%Y.%m.%d %H:%M:%S] '
so you see exactly when you executed the command
â Robert Riedl
Feb 14 at 9:56
add a comment |Â
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!
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, withPROMPT_COMMAND="history -a"
in the.bashrc
described here. Although I'm not sure I can recommend that... what I would recommend is setting aHISTTIMEFORMAT
like thisexport HISTTIMEFORMAT='[%Y.%m.%d %H:%M:%S] '
so you see exactly when you executed the command
â Robert Riedl
Feb 14 at 9:56
add a comment |Â
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!
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!
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, withPROMPT_COMMAND="history -a"
in the.bashrc
described here. Although I'm not sure I can recommend that... what I would recommend is setting aHISTTIMEFORMAT
like thisexport HISTTIMEFORMAT='[%Y.%m.%d %H:%M:%S] '
so you see exactly when you executed the command
â Robert Riedl
Feb 14 at 9:56
add a comment |Â
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, withPROMPT_COMMAND="history -a"
in the.bashrc
described here. Although I'm not sure I can recommend that... what I would recommend is setting aHISTTIMEFORMAT
like thisexport 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
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password