$ history | wc -l 56201 I use a simple prompt_command hook to push my history (from all my machines) to a central MySQL database( https://github.com/fredsmith/history-db ). Entries are de-duped and a tally is kept so I can do simple ad-hoc reporting: mysql> select * from history order by count DESC limit 10; +-------+---------------------+-----------+----------+-------+ | id | timestamp | command | hostname | count |…
“I have [bash] history back to ~2003”
141–148 of 148 posts
Re: “I have [bash] history back to ~2003”
#142Earlier quoted context omitted.
Your shell is likely configured to write to the file, instead of appending to it. shopt -s histappend In your .bashrc should do. To have it write after every command take a look at http://unix.stackexchange.com/a/1292
Some people dislike it, but I LOVE it. I like being able to run a command, open a new terminal, and be able to control-r to find that command again. It ensures that I don't have race conditions over which terminal writes its history to disk first, as well, so I lost far fewer (zero?) history elements.
Re: “I have [bash] history back to ~2003”
#143And due to the way Bash is developed, all you need is the same Bash executable you had in 2003 to ensure all the commands actually work.
Re: “I have [bash] history back to ~2003”
#144$ history | wc -l 56201 I use a simple prompt_command hook to push my history (from all my machines) to a central MySQL database( https://github.com/fredsmith/history-db ). Entries are de-duped and a tally is kept so I can do simple ad-hoc reporting: mysql> select * from history order by count DESC limit 10; +-------+---------------------+-----------+----------+-------+ | id | timestamp | command | hostname | count |…
Re: “I have [bash] history back to ~2003”
#145I 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.
Do you have any links to resources you used to build it or better yet a link to your implementation? I've been pretty happy with my bash history solution, but thinking about the return value, one big thing I think would be handy would be to have a default filter for searches that removes commands that returned an error code. They might be handy to see every once in a while, but for the most part, I wouldn't want to r…
I use bash-preexec [1] to hook on the even just before executing a command. I'm kind of nervous if my string quoting is safe though.
Re: “I have [bash] history back to ~2003”
#146Earlier quoted context omitted.
I'd be quite interested in someone provided this sort of thing as a SaaS-like drop-in to Bash and Zsh if someone wants a fun weekend project..
http://shell-sink.blogspot.com/ used to provide this service - it was what I based my project on. I'll see what I can do for a hosted/SaaS system this weekend.
Re: “I have [bash] history back to ~2003”
#147Earlier quoted context omitted.
http://shell-sink.blogspot.com/ used to provide this service - it was what I based my project on. I'll see what I can do for a hosted/SaaS system this weekend.
Any luck? :)
Re: “I have [bash] history back to ~2003”
#148Earlier quoted context omitted.
Any luck? :)
I started working on something myself--should have something out in a day or two :)