News for hackers. Stuff that matters.
Re:“I have [bash] history back to ~2003” by fps on Thursday September 03, 2015 @08:45AM (#10164577)

  $ 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 |
  +-------+---------------------+-----------+----------+-------+
  |     1 | 2015-09-02 19:41:45 | ls        | xicada   | 34458 |
  |    89 | 2015-09-02 14:58:33 | cd ..     | xicada   |  4332 |
  |   519 | 2015-08-24 18:38:55 | ll        | xicada   |  3229 |
  |     9 | 2015-09-02 12:37:05 | cd        | xicada   |  2250 |
  |    82 | 2015-08-28 18:27:07 | add       | xicada   |  1887 |
  |   329 | 2015-08-31 18:22:49 | gs        | xicada   |  1817 |
  |    48 | 2015-09-02 19:17:26 | git pull  | xicada   |  1696 |
  |   275 | 2015-08-24 18:23:44 | df -h     | xicada   |  1529 |
  | 15708 | 2013-10-08 01:33:33 | grid unn1 | Europa   |  1210 |
  |    44 | 2015-08-31 13:10:46 | git push  | xicada   |  1139 |
  +-------+---------------------+-----------+----------+-------+
  10 rows in set (0.02 sec)
It's pretty useful (I search through my history constantly with ctrl-R or using bash's history-search-backward hotkeys), and having a 56K line history file doesn't seem to impact history searching or shell startup any noticeable amount.
Re:“I have [bash] history back to ~2003” by pixelbeat on Thursday September 03, 2015 @10:10AM (#10165026)
You owe the GNU coreutils project $392

https://github.com/diafygi/gnu-pricing

Re:“I have [bash] history back to ~2003” by kbenson on Thursday September 03, 2015 @12:21PM (#10165809)
> This project is satire and was made during the 2015 Stupid Shit No One Needs & Terrible Ideas Hackathon.

That's good, because it would be extremely disturbing if someone from the FSF/GNU coreutils team thought charging like this was okay.

Re:“I have [bash] history back to ~2003” by slavik81 on Thursday September 03, 2015 @09:59PM (#10168484)
The 'announcement' for this feature is great for the ridiculous fake quotes. e.g.

"We've scaled enough. It's time to monetize." -Richard Stallman, Founder. FSF.

https://diafygi.github.io/gnu-pricing/website/

Re:“I have [bash] history back to ~2003” by gajjanag on Thursday September 03, 2015 @12:21PM (#10165811)
I agree with the general idea that contributing to these projects is good. However, the link is slightly misleading: "GNU programs are used billions of time every day all over the world. However, the intellectual property owners, the Free Software Foundation, don't make a cent from it. What a raw deal! This project aims to fix that by monetizing many popular command line tools that GNU maintains."

Maybe true, but keep in mind that the main coreutils maintainers (including the parent) are funded by Red Hat. There are plenty of FOSS projects that do suffer from a lack of funding; coreutils, GCC, etc are certainly not one of them. As such, if your goal is to help the FOSS community at large, you might want to consider channeling the money to other important projects.

Maybe the donation link already does such channeling; I am curious about this.

Re:“I have [bash] history back to ~2003” by zcdziura on Thursday September 03, 2015 @01:41PM (#10166387)
woosh! The sound of sarcasm going over your head.

This project is entirely satirical. Read through to the bottom of the README.

Re:“I have [bash] history back to ~2003” by pixelbeat on Thursday September 03, 2015 @01:33PM (#10166306)
It's a joke
Re:“I have [bash] history back to ~2003” by geofft on Thursday September 03, 2015 @01:40PM (#10166374)
It's a joke that's very much not obviously a joke. This is social commentary about the state of free software and/or Hacker News, I'm just not sure what the social commentary actually is.
Re:“I have [bash] history back to ~2003” by brazzledazzle on Thursday September 03, 2015 @02:31PM (#10166723)
Seemed pretty obvious to me.
Re:“I have [bash] history back to ~2003” by bsddb5 on Thursday September 03, 2015 @11:05AM (#10165325)
What leads you to believe OP doesn't use FreeBSD or any other Unixalike? :)
Re:“I have [bash] history back to ~2003” by fps on Thursday September 03, 2015 @11:25AM (#10165444)
I mostly do (MacOS), but:

  $ which ls
  /usr/local/opt/coreutils/libexec/gnubin/ls
I'd say $392 seems like less than I should contribute.
Re:“I have [bash] history back to ~2003” by kbenson on Thursday September 03, 2015 @12:24PM (#10165828)
Well, if it's shipped from Apple as part of their OS (I'm not sure it is from your path), then Apple would be responsible for licensing it.

Which makes me wonder, does Apple have an official stance on supporting open source they use?

Re:“I have [bash] history back to ~2003” by TheCoelacanth on Thursday September 03, 2015 @12:41PM (#10165918)
It's not. Default ls on Mac OS X is /bin/ls.
Re:“I have [bash] history back to ~2003” by kbenson on Thursday September 03, 2015 @12:45PM (#10165953)
I figured as much. I'm sure Apple is using some BSD version, possibly modified in-house.
Re:“I have [bash] history back to ~2003” by Kalium on Thursday September 03, 2015 @12:51PM (#10165990)
OS X has been based on an amalgamation of several BSD flavors for a while now.
Re:“I have [bash] history back to ~2003” by fps on Thursday September 03, 2015 @01:34PM (#10166314)
no, I installed gnu coreutils using homebrew. - /usr/local/opt/ is where homebrew puts installed binaries.
Re:“I have [bash] history back to ~2003” by odonnellryan on Thursday September 03, 2015 @10:22AM (#10165088)
This is actually awesome!
Re:“I have [bash] history back to ~2003” by smellf on Thursday September 03, 2015 @07:22PM (#10168069)

  $ history |wc -l
  82230
This is just from my work machine (~4 years old), my history is not centralized but after seeing all this I think I'm going to work it into my centralized dotfiles system.

Also, I can confirm that gigantic bash histories don't affect the speed of anything.

Super useful/essential tweaks -

  export HISTCONTROL=erasedups
  export HISTSIZE="NOTHING"
  export HISTFILESIZE="NOTHING"`
  shopt -s histappend
  export PROMPT_COMMAND='history -a;echo'
erasedups will erase any earlier instance of an indentical command, keeping your history file lean. Setting HISTSIZE and HISTFILESIZE to something nonnumeric makes for no limits. histappend appends to the HISTFILE when the shell session exits. And my prompt command appends each executed command to HISTFILE immediately after it's executed. With histappend, this may be redundant. (The prompt command also gives me a blank line after each command finishes.)

That mysql setup is pretty cool too, it's a rich man's

  $ history | awk '{print $2}' | sort | uniq -c | sort -rn | head -10
  14365 vi
  11006 sudo
   6976 ls
   6898 svn
   5322 cd
   3869 cdb
   2809 svnvimdiff
   1846 ggrep
   1474 git
   1285 ssh
Re:“I have [bash] history back to ~2003” by lamby on Thursday September 03, 2015 @09:32AM (#10164815)
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..
Re:“I have [bash] history back to ~2003” by michaelmior on Thursday September 03, 2015 @10:32AM (#10165134)
You could really do some interesting stuff with this. Automatically recommend aliases and show how many keystrokes you would have saved for example.
Re:“I have [bash] history back to ~2003” by Vexs on Thursday September 03, 2015 @11:19AM (#10165407)
Stuff like swiftkey automatically recommends next words, it might not be that difficult to have a similar system for a shell. Sounds like a fun idea actually.

Oh, relevant XKCD. https://xkcd.com/1068/

Re:“I have [bash] history back to ~2003” by nitrogen on Thursday September 03, 2015 @11:31AM (#10165484)
Could be risky if the recommendations for "rm" are "-rf" and "/".
Re:“I have [bash] history back to ~2003” by fps on Thursday September 03, 2015 @09:38AM (#10164835)
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” by lamby on Tuesday September 08, 2015 @06:39PM (#10188601)
Any luck? :)
Re:“I have [bash] history back to ~2003” by alphast0rm on Wednesday September 09, 2015 @07:24PM (#10195324)
I started working on something myself--should have something out in a day or two :)
Re:“I have [bash] history back to ~2003” by rcaloras on Tuesday September 22, 2015 @11:45PM (#10263218)
FYI this has been a side project of mine for a while. I call it Bashhub. Check it out if you're interested! Bash history in the cloud. Indexed and searchable.

https://github.com/rcaloras/bashhub-client

https://bashhub.com

https://bashhub.com/u/rccola

Re:“I have [bash] history back to ~2003” by willcodeforfoo on Thursday September 03, 2015 @11:38AM (#10165523)
I've wanted this as well... plus keep track of how long commands took to run and (heck, why not?) output!
Re:“I have [bash] history back to ~2003” by logicallee on Thursday September 03, 2015 @12:07PM (#10165712)
this must be some kind of record, in 15 words you took something great, started adding unnecessary, creeping features, and ended up with bloatware no one wants to use anymore :)

Usually this takes years!

Re:“I have [bash] history back to ~2003” by michaelmior on Thursday September 03, 2015 @10:31AM (#10165131)
On one hand this really seems like overkill. On the other hand, this is incredibly awesome. Thanks for sharing :)
Re:“I have [bash] history back to ~2003” by godzilla82 on Saturday September 05, 2015 @06:32AM (#10174441)
It seems all you do is git pull, push and check disk usage!! Do you really check disk usage almost as often as you do git pull and push? You do push and pull more than commits?!! I cant understand what is that you do if you dont use other commands like grep, find, vi, top as often?
Re:“I have [bash] history back to ~2003” by eevilspock on Thursday September 03, 2015 @11:35PM (#10168704)
When I pipe history (to wc, grep) that is greater than 65K bytes on OS X, it hangs. Anyone else experience this or have an idea how to fix?
Re:“I have [bash] history back to ~2003” by bechampion on Thursday September 03, 2015 @12:36PM (#10165895)
cray good man