Live data from Hacker News

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

twitter.com

41–50 of 148 posts

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

#41
post #29

Here's something interesting - We collected bash history of around 15000 users and listed frequented used commands for fun :) http://www.webminal.org/fulc/

Kind of interesting, might be more interesting to see what the other end of the distribution looked like, i.e. the really esoteric commands that people rarely use. We all might learn something from that!

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

#42

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.

I'm a computational biologist. I often need to know exactly how some piece of analysis was done months or years ago. In an ideal world all the details would be in scripts with carefully written READMEs cross-linked from my lab notebook, but it's not an ideal world and sometimes we're in a hurry. In those cases the history saves my bacon.

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

#43

bash history had never seemed to work for me between tmux windows. Commands are 'trapped' in their respective window and the last one to close 'wins' and writes its history over the others. So I end-up with never-closing task-based window sessions and occasionally copy-paste commands to a safe file for future reference. I really should investigate the root cause some day...

This is one reason why this method uses a different file for every single shell session.

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

#44
post #41
post #29

Here's something interesting - We collected bash history of around 15000 users and listed frequented used commands for fun :) http://www.webminal.org/fulc/

Kind of interesting, might be more interesting to see what the other end of the distribution looked like, i.e. the really esoteric commands that people rarely use. We all might learn something from that!

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 :)

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

#45
post #4

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

that would be why you don't put sensitive information in the command line :)

Sorry—I meant to upvote but fat-fingered a downvote.

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

#46

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.

Try binding the and keys (or whatever keys you want) in you ~/.inputrc to the readline commands "history-search-backward" and "history-search-forward". See bash(1) in the READLINE section details.

Instead of simply scrolling through your recent bash history when you press (which still works the same when your prompt is empty), it filters out any command that don't match the partial command you've already typed. For example, typing "cp " and then pressing up will find the last "cp" command that I typed.

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

#47
post #44
post #41

Earlier quoted context omitted.

Kind of interesting, might be more interesting to see what the other end of the distribution looked like, i.e. the really esoteric commands that people rarely use. We all might learn something from that!

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 :)

I think ".." was "cd .." in dos

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

#49

bash history had never seemed to work for me between tmux windows. Commands are 'trapped' in their respective window and the last one to close 'wins' and writes its history over the others. So I end-up with never-closing task-based window sessions and occasionally copy-paste commands to a safe file for future reference. I really should investigate the root cause some day...

Put

    shopt -s histappend
    export PROMPT_COMMAND="history -a;$PROMPT_COMMAND"
in your ~/.bashrc.

Also, if you want fresh history in an already opened window (assuming you added the above), do "history -n". E.g. if you typed "longcommand" in window1, then switch to window2, do "history -n" and uparrow, and "longcommand" will be there.

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

#50
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 :)

I think ".." was "cd .." in dos

hmm..that's interesting,I never knew that. thanks.
Post reply on HN