Linux terminal users be like
Linux terminal users be like
Linux terminal users be like
Ctrl R > start typing
You're welcome to have your life changed
What the actual.... Thanks
Finally the ls
command!
Up up up up up up up up up oh wait down
you allllways overshoot
Based
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!
Bruh. Ctrl-r
you're amazing, this is going to change how I use fish
Or the history substring search plugin for zsh showing inline history as you type, like fish.
~/.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
Bro, do you even ^R
?
Time to up your game with Ctrl + R reverse search! 🤓
Oh, and Ctrl + Shift + R brings you back in the search, niiiiice.
Thank you kind stranger 👍 ☺️.
Look up fzf for luxury treatment
ctrl+p gang RISE UP
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.
history | grep
<search term>
Does the job well if the key combo doesn't work.
Followed by !xxx where xxx is the number of the command to re-run
This. I didn't know about CTRL+R, but this has been my goto
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
cat .bash_history | grep keyword
But yeah pretty much.
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 wanthistory | grep term
Guilty. Even knowing better ways laziness wins. Skyrim console too.
"\e[A": history-search-backward
"\e[B": history-search-forward
Thank me later
Man, I've been on unix systems since, oh, 1994, but I've never messed with my .inputrc ... may need to take the dive....
Ok this is actually great. Is there a way to make it so when you down arrow again it will clear the cmd line (or take it back to the prefix)?
Like "py" -> up -> down -> result is "py"
Currently it would show my last python command (or whatever matches).
Hey! Sorry just getting into Linux, I love learning about cool ways of doing things more efficiently. What does this do exactly? I've noticed others mentioning CTRL+R and I am not sure what that means either. Thank you!
Basically, while ctrl+r is nice, this is how I got used to use my system. What this does is enable search for when you press arrow up. If you type nothing then it’s default behavior but if you type “ssh” and then start pressing arrow up it will bring up the previous command that had the word ssh in. It’s worth it for someone who constantly forgets ctrl+r exists
esc + k
for me!
(vi for life)
Me when configuring a switch.
And the command is something like ls -l
👍
I usually use ls -hal
.
ls -lah
is what I do 🙌
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.
Ctrl+R together with fzf
makes this obsolete
fzf
is pretty cool, but I found its ctrl-r "menu" to be more confusing than the old "one entry at a time" style.
(Ofc could be a configuration thing but I'm somewhat an oldhat when it comes to my terminal habits.)
my humble method: history | grep -i searchterm
Then ![historynumber] to execute it
Since this post triggered hidden gems: ^old^new
will substitute old
with new
from the last command and execute.
Fish finally broke me of this habit, and now it's one of the first things I install on any system
One of the top reasons I use fish is that I never learned how to cycle through the results of ctrl+r in bash
another happy fish convert here too!
Fish? Please enlighten a casual user
Friendly Interactive SHell. I also use it, and I find some of the extra features delightful. I don't think it's POSIX compliant if you're one of the two dozen people who have to worry about that for your use case.
Fish Shell - Friendly Interactive Shell. It has tons of themes and customizable prompts, but most importantly it scans through your command history and autocompletes previous commands. You can even to back through previous versions of a certain command for example I copy a couple different files a lot so I'll type 'cd' then press up to get to the specific command I need. It'll also autocomplete command names if they're in the path. It's a life changer for sure
ah there's my password...
$ ls -la
ls -hal
ls -halal
history | grep {some part of command}
Much more useful for going further back, even without grep.
As some one who SSH's from a phone to run Docker containers and will be moving the container volumes to a different location, I thank you for this lovely command.
no I don't want to write the single word command out again I'd rather go up the history with more keypresses
I've just signed up to this site and I'm being personally attacked already. smh
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.
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 type ls
. LOL.
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.
If you enjoy that, then let me introduce you you fzf - a fuzzy finder that has support for replacing ctrl + r in shells with fuzzy matching. Among other uses.
https://github.com/junegunn/fzf#key-bindings-for-command-line
Man I over use it at work - even when sitting in front of a pwsh prompt
You can also install https://github.com/dvorka/hstr to supercharge your
ctrl+r
I can recommend fzf since it also supports searching the current directory
This is it, my first saved comment on lemmy
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.Finally the ls command!
Fish gang arise (no need for ctrl+r, just press up)