LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   ctrl + r not picking up the latest commands in history (https://www.linuxquestions.org/questions/ubuntu-63/ctrl-r-not-picking-up-the-latest-commands-in-history-4175579807/)

salilsurendran 05-14-2016 06:34 PM

ctrl + r not picking up the latest commands in history
 
when I enterl ctrl + r and enter a search term it goes back in distant history and never finds the commands that I most recently typed that has this keyword

rknichols 05-14-2016 09:23 PM

Are you doing this in the same shell session where you typed that command? A shell only reads the history file once when it starts up, and only writes to the file once when it exits. A different shell session will not see anything that was done in another, currently running shell. Also, the default for bash is to overwrite the HISTFILE completely upon exit, so any entries that another shell made since this shell was started will be lost.


All times are GMT -5. The time now is 05:05 AM.