S
S
Sergey c0re2021-11-22 13:34:28
linux
Sergey c0re, 2021-11-22 13:34:28

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


Why? how to cure it, tired of "ripping" the story.

PS: Linux Mint 18.3 XFCE

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vitaly Karasik, 2021-11-23
@erge

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.

S
SOTVM, 2021-11-22
@sotvm

patamu chta, read how search works by Ctrl + r
search like this
history | grep 64042

A
Alexander Karabanov, 2021-11-22
@karabanov

Click Ctrl+ra few times.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question