Answer the question
In order to leave comments, you need to log in
Why is there no command in the terminal via Ctrl+r, although it is in ~/.bash_history?
Why is there no command in the terminal via Ctrl+r, although it is in ~/.bash_history?
I enter Ctrl + r in the search, I type part of the command 64042 issues
ssh [email protected] -2CL 64040:localhost:1521
????
Although there are already 6 entries in the history!
$ grep 64042 ~/.bash_history
ssh [email protected] -2CL 64042:localhost:1521
ssh [email protected] -2CL 64042:localhost:1521
ssh [email protected] -2CL 64042:localhost:1521
ssh [email protected] -2CL 64042:localhost:1521
ssh [email protected] -2CL 64042:localhost:1521
ssh [email protected] -2CL 64042:localhost:1521
Answer the question
In order to leave comments, you need to log in
Because more commands are stored in .bash_history than in "history". I don't know why, but there are two settings in bash:
HISTFILESIZE=10000
HISTSIZE=2000
In my example, the search will be on the last 2000 commands, and 10000 are stored in the file.
patamu chta, read how search works by Ctrl + r
search like this
history | grep 64042
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question