ctrl + r
gangHoly Crap. I have gotten into the arrow up mode. Then I went to History.
But, but, but ctrl + r. Holy crap.
Thank you kind sir or madam.
You can also install https://github.com/dvorka/hstr to supercharge your
ctrl+r
This is it, my first saved comment on lemmy
I can recommend fzf since it also supports searching the current directory
Fish gang arise (no need for ctrl+r, just press up)
Is there a MacOS versión of this? Asking for a friend.
It’s the same,
ctrl
+r
. It is a bash/shell thing so works on any os that uses bash or similar shells. Note, it is not the command key, but ctrl, unlike a lot of other shortcuts on macos.
Bro, do you even
^R
?Or
history | grep {command}
i have a alias for h which is history, then hg which does this and i can search my whole 52 thousand line history file and find anything i’ve ran
Finally the
ls
command!cat /var/www/vhosts.d/l[tab]o[tab]l[tab]a[tab]…
lola 🤨?
cat /var/www/vhosts.d/lolanotherfilehasthesamenamebutwith1.conf
Up up up up up up up up up oh wait down
you allllways overshoot
Based
Ctrl R > start typing
You’re welcome to have your life changed
What the actual… Thanks
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…
ls -la
ls -hal
ls -halal
~/.bash_history is where my documentation lives
yeah, the other day i was supposed to remove a restriction from a router that was some custom thing built on a raspberry pi. i logged in, started messing around, trying to figure out the system, and of course i looked at bash_history because why not, i’m unfamiliar with the setup so it seemed like a good place to start. up until i found some commands editing it. so i’m like
$ export HISTFILE=/dev/null # alright, two can play this game
it ended up being a simply cron job that runs a script that starts and stops hostapd every once in a while. i didn’t disable the cron job, i just commented out a critical line from the stop script. happy debugging to the sysadmin, lol
I usually do ctrl+r but with zsh I can type the beginning of the command and press up and it will search that way too.
fish automatically searches as you type, just start typing and press -> when you find the command you need.
Zsh does the same, though I think you need oh my zsh and a plugin for it.
history | grep term
Me when configuring a switch.
cat .bash_history | grep keyword
But yeah pretty much.
I try to avoid the terminal as much as I humanly can because of ergonomic issues like this.
y… you do realise this is a meme, right? If you want to find a specific command that you ran in the past, you can just hit ctrl-r and search for it? No-one is actually spamming the up key, it’s a joke.