4 ms·
What should I be using shell history for? I've never wanted to go back in my history but obviously people are getting a lot of value from it.
by motoxpro 3y ago
What should I be using shell history for? I've never wanted to go back in my history but obviously people are getting a lot of value from it.
- absoluteunit1 3y agoI’ll sometimes write a useful one liner that I want to write a shell script off but if I’m in the middle of something and don’t have time I’ll do this: <my> | <cool> | <one liner> # add script for this The # comment makes it easy for me to search through my history to find one liners I want to use to build a shell script from
- paxys 3y agoHave you even used the up arrow key to go back to your last command? This is like that, but does a lot more.
- pjmlp 3y agoMinimize typing as much as possible.
- paxcoder 3y ago[dead]
- todd3834 3y agoHere are some of my often use cases: Long kunernetes commands, or ssh into an ip you don’t have remembered, curl commands when testing an api. Anything on the CLI that is long and either hard to remember or just annoying to type.
- bdzr 3y agoI've tried to move all of my kubectl workflow into k9s, the CLI is just way too verbose.
- lovestaco 3y agoTrue I use mcfly[1] works pretty smoothly for me [1] https://github.com/cantino/mcfly https://github.com/cantino/mcfly
- shaneoh 3y agoI use [Shuttle](https://fitztrev.github.io/shuttle/ https://fitztrev.github.io/shuttle/) for that ssh issue which often comes in handy. Should solve for most of those CLI command issues.
- JohnMakin 3y agoI tend to write scripts or docs when things are annoying and hard to remember. shell history is usually littered with sensitive stuff, I usually go way out of my way to prevent my machines from saving any of it, but to each their own.
- ellieh 3y ago> shell history is usually littered with sensitive stuff Atuin is trying to solve this one too :) By default it won't save history containing AWS credentials, slack credentials, etc. The list of things to ignore is configurable with regex While it's not difficult to avoid putting credentials into your shell, ik most people will just paste things in that perhaps they should not
- cimnine 3y agoI often hit CTRL-R to reload a services config. I press `CTRL+R`, enter `reload`, and continue to hit `CTRL+R` until the right service appears. Enter. Done. Usually way quicker, especially when switching between distros. As one calls it httpd and one apache, once it's systemd and once it's and init script, and so on.
- WinstonSmith84 3y agoYes I'm using this command occasionally. While clearly the demo of Atuin (https://atuin.sh/ https://atuin.sh/) looks cool and more powerful than ctrl+r, I must say that ctrl+r has always been enough to me.
- CraigJPerry 3y agoI feel like I get a decent return on mining historical command usage for new (single keystroke?) aliases to setup, the most useful ones change over time for me. Another use case I feel pays off is complicated one-liners where I need to do something similar but not quite the same again - good starting time saver. This depends on you being a mostly cli kinda person obviously, if you instinctively reach for excel over awk then ymmv.
- rcpt 3y agoI don't really know how to use awk and ctrl-r is faster than going back to stackoverflow to figure out what I did last time
- theshrike79 3y agoI'm lazy and I don't want to type With fish's shell history for example I can just type 's' and it completes it to 'ssh user@host.tld', because that's the last one starting with S I used. If it's not right, I can type it up to 'ssh' and press arrow up to pick the ssh command I want. Then I might remember that I did this fancy jq thing once to parse a field in a specific way, I can easily use Atuin to look for it with a nice text-mode UI just by pressing C-r and typing 'jq' as the initial filter.
- noelwelsh 3y agoI'm similar. I do most of my work in Emacs and I don't do much sys admin, so I don't really use the shell much. It's always interesting to me to see other people's workflows, though.
- baq 3y agoit's like having a multi-register clipboard in that once you figure out the workflow, it's hard to go back. ...but if you effectively have this in emacs, I can see why you wouldn't need it in the shell.
- sevagh 3y agoNot to be dramatic but atuin is life-changing. I can resume my working context from any project, no matter how far in the past (e.g. what docker or cmake or make commands I run). I don't need a personal wiki of cli tricks like an "ffmpeg cheatsheet" or whatever, I just access my own personal ffmpeg history. Oh, also, I use tmux to split my terminal and do separate things in each one, so I like that atuin consolidates all the histories from my separate panes.