Look, I'm lazy, okay? - Lemmy.world

⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬇️ ⬇️
control shift R, then start typing, it will search your bash history
Now if you had to guess how often I remember that there is a keyboard shortcut that does this, but don't remember what it is, and do remember that I can just press up 30-70 times...
you can hit it again after you are dialed in as much as you want and it will keep going back in time with the words you have in there and stuff that matches!
Why r? Maybe if I knew why r, then I wouldn’t forget this every 13 seconds…
Hmm, normally it's just ctrl - r... Are you sure the shift is needed on your system?
you are right, I must have just learned it with a shift for some dumb reason and it stuck, thank you internet person.
Some variants have ctrl+r bound to something else
It's not about the keystrokes. It's the principle!
Lol stop attacking me! 😭
GitHub - junegunn/fzf: :cherry_blossom: A command-line fuzzy finder

:cherry_blossom: A command-line fuzzy finder. Contribute to junegunn/fzf development by creating an account on GitHub.

GitHub
history | grep {search term}

history | grep ‘command’

I use this all the time. Even better if you add it as a function.

I got that as hgrep
Mine is hists for ‘history search’. Interesting how we came up with different names for the same thing.

This is my approach, and for those who don't know, you can use those line numbers that come back from history to rerun the command. Like if your output is something like this:

$ history | grep tmp 501 ls /tmp 502 history | grep tmp

You can run !501 and it will just re-run ls /tmp

Yall are missing out on autocomplete.
I love autocomplete, use it all the time.
up up up up up up up up oh wait down
old habits die hard autocomplete for your shell is so clutch though
I’ve always used set -o vi. Let’s you use vi commands on the bash prompt.
up, up, up, up, up, cd …, ah there it is.
I just use the ‘fuck’ command after lazily typing letters that somewhat match the command I want to run
It's even faster if you look for it inside .bash_history.
This is why I switched to fish; it seems to be much smarter understanding what I want to type.
Yeah it’s great how ctrl-r is kinda the default instead of something you have to go out of your way to use. Just start typing a command and the up arrow will only cycle through history that matches what you’ve typed so far.
Yeah it’s great how ctrl-r is kinda the default instead of something you have to go out of your way to use. Just start typing a command and the up arrow will only cycle through history that matches what you’ve typed so far.

Ctrl+R

Then type any part of the command (filename, search string, etc)

Ctrl+R again to cycle through the matches.

(Best feature in bash)

But how to go backwards and forwards through the results? I just cycle through again!!
Or history | grep ‘command’
Can’t just hit enter to run the one you want then, though.
Also works in fish
fzf masterrace
Yeah but last time I typed it, it worked. Who knows what ridiculous typos I’d make right now?
Using the history command just to find the specific IP I need to ssh to
More like to find ping -O 8.8.8.9
Tfw I rather type it out instead of searching through the history

I use xonsh, which has decent history - start your command, and up arrow cycles through commands stating with what you typed.

There’s good stuff and bad stuff about xonsh.

I rarely use fuzzy finder to search up the commands that I’m going to use. If you realise that a certain command with arguments is often being used, you should create an alias for it so that you don’t have need that memory load. That being said, I appreciate shell like fish provides auto complete (derived from command history) to speed up my workload.
i use vi mode in zsh for that reason, its pretty good