Guilty. Even knowing better ways laziness wins. Skyrim console too.
ctrl + r then enter phrase
With fzf!
I haven’t been on linux in a while but i remember using a file manager that had fuzzy finder and it was nice. I miss linux actually. oh well!
Finally the
ls
command!cat .bash_history | grep keyword
But yeah pretty much.
Why not just
history | grep keyword
then? Works in any directory.You know you don’t actually have to do cat 😂. But yeah, I know, I do it as well 🤣.
Yeah, I grep on history and then !<number> to execute the line I want
Ctrl R > start typing
You’re welcome to have your life changed
What the actual… Thanks
$ ls -la
ls -hal
ls -halal
ah there’s my password…
The command is ls
Since this post triggered hidden gems:
^old^new
will substituteold
withnew
from the last command and execute.I’ve just signed up to this site and I’m being personally attacked already. smh
Y’all know about ctrl-r to search history, right? I went for so many years without even thinking to look for something better than up-arrow, so I have to mention it.
Wait until they learn that you can
ctrl+u
when you mistyped your password insudo
instead of spamming backspace…Bro. You just changed my life and don’t even realize it
Here’s another mindfuck: gnu readline is so popular that developers of other software tend to implement its keybinds as hidden features/eastereggs. That’s why ctrl+u works in GTK text input boxes as well!
I end up hitting Ctrl+u at work all the time and then being disappointed and holding backspace.
What does that do?
Delete until start of line. So essentially equivalent to spamming backspace a bunch.
history | grep <search term>
Does the job well if the key combo doesn’t work.
This. I didn’t know about CTRL+R, but this has been my goto
Followed by !xxx where xxx is the number of the command to re-run
And the command is something like
ls -l
👍I usually use
ls -hal
.ls -lah
is what I do 🙌
I feel this in my soul. Or when you realize you’re hitting up up up up to find something trivial like
ls
and it would have been more efficient to just typels
. LOL.Me when configuring a switch.
history | grep term