Live data from Hacker News

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

twitter.com

31–40 of 148 posts

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

#34
Unfortunately, I only started saving my history somewhat recently.

    $ cat ~/var/history/bash.d/* | wc -l
    464291

    $ for year in 201{2..5} ; do
          echo -n "${year}: "
          cat ~/var/history/bash.d/${year}* | wc -l
      done
    2012: 116285
    2013: 175525
    2014: 117928
    2015: 54553
It's not a complete history, as I filter several commands with HISTIGNORE.

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

#38

Why even store your bash history? It's like you store everything you ever said... Would you lose your precious time to go through the old stuff? I wouldn't.

Why wouldn't you? Do you really type long commands from scratch? I don't know how folks don't use bash reverse search on a regular basis.

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

#39
post #7
post #4

Great resource for hackers if they someday get access to your account.. but I guess you will have bigger problems than.

Yeah, I think they can do more harm with .ssh/id_rsa than with .history.

In practice I've had better luck with shell history than SSH keys when exploiting arbitrary file reads. The history tends to reveal interesting locations.

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

#40
I have and bound to history-search-backward and history-search-forward respectively, so

ls

inserts the most recent command in history that begins with 'ls ' in the command prompt. I don't know why this isn't the default, as it's extremely handy. Also it works with any CLI program that uses readline.

If you want to try it out, add this to your ~/.inputrc file.

"\ep": history-search-backward

"\en": history-search-forward

Post reply on HN