Comment by PyWoody
1 day ago
I'm always curious what people get out of their terminal history. About 98% of mine is embarrassing and made for the ether.
Have you ever looked back on your history?
1 day ago
I'm always curious what people get out of their terminal history. About 98% of mine is embarrassing and made for the ether.
Have you ever looked back on your history?
Some things are worth an alias, or a script, some things aren't quite worth either but you still wanna run them again in the future. I think that's where history helps. Awkward niche one-liners. Also sometimes you do something for the first time, take a bit to figure it out, then 6-12 months later it's easier to check your shell history than relearn the process from scratch again. Also sometimes you may want to run something new that's very similar to an old thing you ran, like maybe you forget which rsync args you've been using lately and you wanna use the same ones but on different files. Search up your last rsync, edit paths.
I used to start my history over with each PC, but last year when I upgraded my primary machine I decided to copy over my browser history and shell history in addition to the usual dotfiles and stuff. It's honestly been really nice and convenient. It almost feels like cheating that I can see stuff older than the machine that I did.
>Some things are worth an alias, or a script, some things aren't quite worth either but you still wanna run them again in the future
I think the bigger problem is that sometimes it's just hard to know upfront exactly what is worth an alias or a script. It may at the time seem like something you'll not need to bother with again and then it turns out a year or two later you have to deal with it a fair amount. I guess one could be in the habit of just always documenting absolutely everything and doing aliases/scripts by default but as a practical matter that's a great deal of time given that many one-liners truly genuinely are one-liners that really won't ever get used again.
Automated history recording helps fill that gap. If you find you do need something again down the road that was a certain amount of effort to figure out the first time, the second (or third or whatever your heuristic is) time is when you can make an alias or script for it. Having the history on-hand simultaneously helps give a jumping off point and helps one decide that yes, actually I better formalize this because I had to do it before on dates X, Y & Z.
Why do you care about 99.99% garbage when it's useful exactly for those .01% gems? You don't look back at history, you search for it or it pops automatically
For example, for a command you run once a year you've spent your time researching proper use and created this invokation you'll never remember:
app -x +e -lsadfjku --avoid-footgun old new # maybe valuable comment/search tag for future you
then next year you just type app and have the autocomplete / search for app. Boom, history value received! No need to repeat the research process all over again
I do to find a command that I know I ran that did something but I don't remember exactly how I did it. It's rare, but it's useful to be able to.
With Atuin, I hit ctrl-r and go to directory mode, and get the commands I ran the last time I was in that directory.
Same here, atuin is such a time-saver, especially when it comes "oh dang, I ran this command on another host but I need it here now". It just works as you'd expect!
> About 98% of mine is embarrassing and made for the ether.
Same
> Have you ever looked back on your history?
All the time? I search in my history, re-launch past commands, etc.
Now it's typically recent history, usually same day.
I know about the shortcuts etc. but I also need to at times pipe history into other commands so I've got a two letters alias:
Which greps into my history. I use that h? all the time.
To recover the past working context, not necessarily looking up a specific command (but that, too, – on certain occasions).
I also hold over a decade worth of zsh history and revisit it from time to time to reconstruct the full memory of what I was working on N years ago.