Live data from Hacker News

“I have [bash] history back to ~2003”

twitter.com

1–10 of 148 posts

Re: “I have [bash] history back to ~2003”

#3

I guess the downside of this is that ctrl+r would only search the current day's history? Personally I at least increased the history kept with HISTFILESIZE=500000 and HISTSIZE=5000

Another issue is that it looks like would start a new history file only when a new shell is started. Some people log in fresh every day, but I've got terminal windows on my home machine that have been sitting around for many months...

I guess you'd have to set the history-size etc large enough to hopefully last for the maximum expected shell run-time.

EDIT: hmm, the man page says you can just unset HISTFILESIZE or set it to a non-numeric/negative value to avoid truncating the history file at all.

Re: “I have [bash] history back to ~2003”

#8
I recently set up my bash history to collect into an sqlite database. Besides the exact command it records the working directory, return value, starting time, ending time, a shell and a login session id. It doesn't handle background jobs well right now though.

Re: “I have [bash] history back to ~2003”

#9
post #8

I recently set up my bash history to collect into an sqlite database. Besides the exact command it records the working directory, return value, starting time, ending time, a shell and a login session id. It doesn't handle background jobs well right now though.

Okay I'm curious as to why? I mean it's nice to have, but what are you going to do with the additional data later on?

Re: “I have [bash] history back to ~2003”

#10

I guess the downside of this is that ctrl+r would only search the current day's history? Personally I at least increased the history kept with HISTFILESIZE=500000 and HISTSIZE=5000

There is another reply defining histgrep() function. Maybe ctrl+r could be assigned somehow.
Post reply on HN