News for hackers. Stuff that matters.
Re:Store your zsh history into a sqlite3 database by lolive on Friday August 18, 2017 @10:33AM (#15046507)
OffTopic: I have always considered my (bash) history as a profound source of knowledge. I hope one day, some machine learning wizard will create a function extractor from history. Something like: "oh it seems you often chain those commands: .... Let me make a function for you. Here it is: ... How would you like to call it?"
Re:Store your zsh history into a sqlite3 database by Buttons840 on Friday August 18, 2017 @12:40PM (#15047694)
Have you tried the ”fish” shell? It's the closest I've seen to what you're describing, but not exactly the same.
Re:Store your zsh history into a sqlite3 database by jamescostian on Thursday August 17, 2017 @08:27PM (#15042356)
This looks very cool! I especially love the attention to syncing and merging, as well as the section specifically for zsh-autosuggestions. However, I really wish there were performance metrics (e.g. "zsh-autosuggestions used to take me Xms but now they only take Yms, and I have Z entries in my history")
Re:Store your zsh history into a sqlite3 database by larkery on Friday August 18, 2017 @06:15PM (#15050183)
I don't have any timing data and I don't actually use the autosuggest thing (I wrote that for someone else who asked about it), but I can say that I have months of daily use in mine and there's no noticeable query delay or insertion delay so far.

Sqlite3 is to thank for that, it's a pretty amazing bit of engineering.

Re:Store your zsh history into a sqlite3 database by mjmein on Thursday August 17, 2017 @08:46PM (#15042489)
I've been using this for a while. I like the fact that it stores dates/times of command executed. I plan to combine this with org-mode to quickly get a report of all shell commands executed while I was working on a specific task. Helps if I want to convert it into a guide/blog post.
Re:Store your zsh history into a sqlite3 database by eikenberry on Thursday August 17, 2017 @09:00PM (#15042587)
Not that it affects you, but for others that think have date/time in their history zsh supports this with their EXTENDED_HISTORY (setopt extendedhistory) option. Formats history as...

: <beginning time>:<elapsed seconds>;<command>

Re:Store your zsh history into a sqlite3 database by fs111 on Friday August 18, 2017 @07:25AM (#15045211)
You can do that w/o external tools, at least in bash. Just set HISTTIMEFORMAT. see man bash.
Re:Store your zsh history into a sqlite3 database by torbjorn on Thursday August 17, 2017 @07:52PM (#15042157)
anyone know of something like this for bash?
Re:Store your zsh history into a sqlite3 database by wingerlang on Friday August 18, 2017 @03:12AM (#15044184)
I use this:

> export PROMPT_COMMAND='if [ "$(id -u)" -ne 0 ]; then echo "$(date "+%Y-%m-%d.%H:%M:%S") $(pwd) $(history 1)" >> ~/.logs/bash-history-$(date "+%Y-%m-%d").log; fi'

It just logs everything into files per date, have come in handy at times.

Re:Store your zsh history into a sqlite3 database by tenken on Thursday August 17, 2017 @08:15PM (#15042281)
Re:Store your zsh history into a sqlite3 database by pmoriarty on Thursday August 17, 2017 @07:56PM (#15042184)
Re:Store your zsh history into a sqlite3 database by thenewwazoo on Friday August 18, 2017 @02:14AM (#15043977)
Re:Store your zsh history into a sqlite3 database by saurik on Friday August 18, 2017 @03:11AM (#15044175)
Re:Store your zsh history into a sqlite3 database by pmoriarty on Thursday August 17, 2017 @09:06PM (#15042627)
Re:Store your zsh history into a sqlite3 database by moocowtruck on Friday August 18, 2017 @08:35AM (#15045544)
why do i want to know how many times i type ls!!!!!

j/k This seems pretty cool

Re:Store your zsh history into a sqlite3 database by pmarreck on Friday August 18, 2017 @09:48AM (#15046087)
it stores those under _BORING_COMMANDS and doesn't log them.

Source: Read the source