3 ms·
The other day there was another post about a bash history in a db, years worth and searchable and available on all machines. I do not get this. I have over 30
by Brian_K_White 3y ago
The other day there was another post about a bash history in a db, years worth and searchable and available on all machines.
I do not get this. I have over 30 years certainly cobbled some complicated commands, but I never need an ancient one.
If it's complicated and used more than one day, it's a script.
Complicated or not and used a long time ago, it's no longer valid.
These days "so old it's no longer valid" is barely a year. Back in the sco Unix days you could have 10 year old commands that are still valid references, but Linux never had that except for trivial things.
There are exceptions but they are exceptions and so by definition not reasonable to focus on.
I think that building essentially mini apps right on the command line and then carrying around years of shell history to reuse them is solving a problem the wrong way. A stupid and backwards way.
It's losing sight of what the problem actually is and like growing one weird finger muscle to the size of a leg instead of realizing maybe you're not supposed to still be using a finger for that job.
- petters 3y agoIt's useful for several other things. Automatic logging is one. Another: I compute the commands run most often (candidates for automation). > These days "so old it's no longer valid" is barely a year I don't think this is true (generally). At my work, we use old boring technology for most things (as we should). I don't see how it could be true enough to warrant not keeping a command line log.
- janalsncm 3y agoThe author mentioned this objection and suggested that since the cost of keeping a long history is so low, there’s really no reason not to. Additionally, you may not know a command will be useful in the future at the time you execute it. I suppose everyone’s workflows are different though. I keep a long history but rarely use it.
- deleted 3y ago[deleted]
- jefftk 3y agoI do a lot of analyses as a series of shell commands. Sometimes the command is complex, other times it isn't but the specific arguments I'm using matter a lot. When I need to revisit an old analysis being able to see the commands I was running is incredibly useful for picking up where I left off or answering people's questions about exactly what I did. These are rarely commands so complex that they represent serious programming effort, but that's not why I want to save them. (My approach: https://www.jefftk.com/p/you-should-be-logging-shell-history https://www.jefftk.com/p/you-should-be-logging-shell-history)
- Brian_K_White 3y agointeresting, thank you
- BeetleB 3y ago> If it's complicated and used more than one day, it's a script. That was a great solution prior to tools like fzf. It's more overhead creating such a script than using the OP's solution. In ye old days, I would sort/organize bookmarks. Bookmark search solved that problem. And for a long while, Google solved the problem of even having bookmarks. Same idea here. Why go through the trouble of making a script (and remembering its name), when you can find the command within seconds?
- tomatocracy 3y agoPredictive search/auto completion is incredibly useful. In the browser context, auto completion search from history in the search/URL bar hugely reduces the need to even make bookmarks for top level sites. It's just much easier to type the first few characters of the site I want then hit enter.
- BeetleB 3y agoExactly my point.
- m463 3y agoI have a very common use case. I have had old machines that I have had to recreate or upgrade from scrach, and the shell history is instrumental in supporting this. just a simple example: history | grep pacman