TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Fly through your shell history

244 点作者 lovestaco超过 1 年前

22 条评论

gumby超过 1 年前
I wonder if having the search use context like cwd is a win in practice or not. I’ll have to try this out to see.<p>I’ve been using `history | grep` since forever (usually `history | grep foo | tail -n 5` which has been a single-character alias for more than 30 years). Hard to beat. Since history gives you the line number you can just `!12345` — no need to copy&#x2F;paste, and works through an ssh connection!
评论 #38967408 未加载
评论 #38968004 未加载
评论 #38972284 未加载
评论 #38972268 未加载
评论 #38967330 未加载
评论 #38967606 未加载
helsinkiandrew超过 1 年前
If any one has tried this, can you confirm whether it copes with having multiple shells overwriting the history files<p>There is nothing more disappointing than not being able to find the cool command line I used a week ago because the shell I opened briefly and forgot about has overwritten it - maybe that&#x27;s my poor setup though
评论 #38966207 未加载
评论 #38966065 未加载
评论 #38965466 未加载
评论 #38965566 未加载
评论 #38970863 未加载
paulrouget超过 1 年前
How does it compare to <a href="https:&#x2F;&#x2F;atuin.sh&#x2F;" rel="nofollow">https:&#x2F;&#x2F;atuin.sh&#x2F;</a> ?
评论 #38965458 未加载
评论 #38968315 未加载
评论 #38972049 未加载
评论 #38965395 未加载
评论 #38965585 未加载
carlmr超过 1 年前
This looks really nice. You say you record the number of times a command was executed. I&#x27;m currently using FZF for ctrl-r search, and it&#x27;s amazing, but one thing that bothers me is that I have some commands that I search for and use quite often, but then I don&#x27;t need them for a while, they vanish from my history, and then I need them again.<p>Would the internal database of McFly keep often searched for commands from the past, even though they&#x27;re out of the bash history?
评论 #38965464 未加载
评论 #38966645 未加载
Mizza超过 1 年前
I&#x27;ve been using Mcfly, Autojump (j), and Ag (a) for so long I&#x27;m basically useless on systems where I don&#x27;t have them. Wouldn&#x27;t change it for the world.
devnonymous超过 1 年前
This looks good and I&#x27;m sure it was created to scratch a particular itch but a simple approach to this (in bash) is changing the $HISTFILE depending on &#x27;context&#x27;.<p>I personally have a custom shell function inspired by virtualenvwrapper&#x27;s &#x27;workon&#x27; that sets the stage, so to speak, based on its arguments. One of the things it does is export various env variables including HISTFILE.<p>For me this is a more flexible way to introduce customisation (for instance one of the last thing my function does is look for a project specific function (name of which is env derived) and execute it ...and then it&#x27;s turtules all the way down )
bfors超过 1 年前
For any of the shell history solutions out there (myfly, atuin, fzf) is there a way to filter out commands that failed or had incorrect syntax? In my history there are ... a lot of those. Not that useful to have them hanging around.
block_dagger超过 1 年前
Was expecting a 3d flying simulation featuring shell history as content. Oh well.
评论 #38966311 未加载
评论 #38971972 未加载
dejj超过 1 年前
I hoped for literal flying, like in the Jurassic Park operating system:<p><a href="https:&#x2F;&#x2F;m.youtube.com&#x2F;watch?v=JOeY07qKU9c" rel="nofollow">https:&#x2F;&#x2F;m.youtube.com&#x2F;watch?v=JOeY07qKU9c</a>
lxe超过 1 年前
I&#x27;ve been using fzf ctrl+r for a while now, but i&#x27;ll give ethis a try. Also didn&#x27;t realize homebrew for linux exists!
评论 #38972887 未加载
itslennysfault超过 1 年前
I was today years old when I learned about CTRL+R. I&#x27;ve always just done history | grep<p>Also, I use zsh which filters history when using up&#x2F;down arrows to whatever you typed. So you can do &quot;git&quot; [up] [up] [up] to cycle through all recent git commands which is super useful.
评论 #38972089 未加载
SoftTalker超过 1 年前
Surprised to see such heavy reliance on shell history. I view shell history as a liability. Too much chance of capturing passwords or other secrets and shell history files are the first place an intruder will look for those.<p>My shell history has a limit of 25 commands and is not saved after logout. I very rarely find that to be too short. In almost every case, if I want to repeat a command it&#x27;s either the previous one or no more than a few prior than that.<p>Anything I need to do repeatedly I put in an alias or script or function.
lopkeny12ko超过 1 年前
For the last 5 years, after being fed up with losing or overwriting my bash history, I&#x27;ve installed a daemon on all of my machines that tails ~&#x2F;.bash_history and uploads every new line to a hosted time series database. I wrote some simple tools to query and search through this DB for commands. It&#x27;s a super simple solution but works wonders, especially for digging up a command I ran on a different machine.
zitterbewegung超过 1 年前
What neural network is being used I think it would be better if you told us the neural network that is doing the prediction.
评论 #38969205 未加载
clot27超过 1 年前
I use <a href="https:&#x2F;&#x2F;github.com&#x2F;atuinsh&#x2F;atuin">https:&#x2F;&#x2F;github.com&#x2F;atuinsh&#x2F;atuin</a>
bobbob1921超过 1 年前
As a back up to my large shell history, and using atuin w a self hosted atuin server), on most of my frequently used machines, I have a spunkUF running anyway, so I also have it logging&#x2F;indexing .bash_history (to my offsite spunk server.). (so I have powerful search and timestamps for any of my commands, forever)
reportgunner超过 1 年前
Lost me at &#x27;neural network&#x27;
评论 #38969221 未加载
localtoast超过 1 年前
I&#x27;m enjoying this immensely. Thanks a bunch.
berliner超过 1 年前
Love the name :)
daxdev超过 1 年前
loving the name of this, super useful thx
malablaster超过 1 年前
I find it annoying that the tl;dr summarizes two sentences.
Grimburger超过 1 年前
For something more rustic, an .inputrc file with this:<p><pre><code> # history-search-backward &#x2F; history-search-forward bound to the up and down arrows &quot;\e[A&quot;: history-search-backward &quot;\e[B&quot;: history-search-forward &quot;\e[C&quot;: forward-char &quot;\e[D&quot;: backward-char set show-all-if-ambiguous on set completion-ignore-case on </code></pre> Will search through anything matching what you&#x27;ve already entered. Type something like &quot;gr&quot; and scroll up or down to see all your previously used grep commands. Saw this long ago on here and it&#x27;s on every machine I use now, can&#x27;t live without it. Thankyou to whoever originally posted it.
评论 #38968433 未加载
评论 #38970604 未加载
评论 #38968167 未加载
评论 #38968150 未加载
评论 #38968343 未加载
评论 #38970538 未加载