Tuesday, May 21, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 1106  / 3 Years ago, sat, july 31, 2021, 5:42:14

Today upon bringing up a bash terminal I tried finding a frequently-used command from my bash history via Ctrl-r. To my surprise, it wasn't found. Upon inspecting ~/.bash_history, I saw instances of the command on several lines. Does the command history not work by checking the file, either in real time or against a cached copy?


More From » bash

 Answers
3

It turns out there was a little more nuance than I was aware of: HISTFILESIZE determines the maximum number of lines saved in .bash_history, while HISTSIZE determines the number of lines from ~/.bash_history loaded into a searchable cache. Upon increasing HISTSIZE to match HISTFILESIZE, I was able to find the command via Ctrl-r.


[#2654] Sunday, August 1, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
leadprogres

Total Points: 298
Total Questions: 114
Total Answers: 139

Location: Samoa
Member since Mon, Nov 8, 2021
3 Years ago
leadprogres questions
Thu, Oct 27, 22, 14:52, 2 Years ago
Thu, Nov 25, 21, 11:01, 3 Years ago
;