Live data from Hacker News

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

twitter.com

61–70 of 148 posts

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

#61
post #25

I wish I had bash history that long. Never seems to have the command I want when I look for it.

I think it's better to simply learn the commands than to have a tremendous amount of history logged. If you have to type a lot of command parameters a lot you can always automate that with aliases anyway.

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

#62
post #44

Earlier quoted context omitted.

We have common mistakes list http://www.webminal.org/common_mistakes/ but didn't figure-out something like which is the least-used valid command. Good idea, we will dig deeper into their bash_history :)

You should also analyse commands that were run without 'sudo'. For me, using 'apt-get install' without sudo has been the most frequent mistake I have made. Luckily, 'sudo !!' saves me every time.

thanks for the nice suggestion. Will analyse this type of common mistake too.

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

#64
post #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?

I maintain almost all my bash history and I often use it to reconstruct a sequence of events in the past when I feel like maybe a mistake had been made.

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

#67
post #60
post #51

Earlier quoted context omitted.

Some linux distros (used to?) alias ls -a to la, which would explain why you're seeing it so often.

And some would also alias "ls -la" to ll. Just never the computer I'm using at the time.

yes, from time to time, I used to perform 'll' too. I guess some distro comes with that alias by default.

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

#70
post #28

I use zsh per directory history [0] as well as this cron job I have set to run hourly: #!/bin/bash cd /Users/nmjohn/.directory_history \ && git add . \ && git commit -m "Automatic Backup: `date`" \ && echo "Files Modified:" \ && git log head -1 --name-only --pretty=format:"" | grep "[^\s]" | awk '{print "\t\t"$0}' \ && echo "" It's not bullet-proof, but since I never manually touch the directory it's worked without h…

Great to hear you find per-directory-history useful! (I wrote it)

On the topic of the article I have per directory history going back to ~2013 when I wrote the script.

Post reply on HN