i just do a command close to what i want but slightly wrong just so i can do thefuck
bash users… zsh is much better
How?
type part of the command, then press up and it’ll complete it from your history….
also i suggest Oh-My-Zsh for nice colors in the terminal
the first time you do it you’ll get angry at all the time wasted in bash… also with oh my zsh it’ll show you what branch you’re in in a git repository… it’s great.Thanks! I have zsh on some of my machines, and installed zpresto on some but never got the advantages… probably due to bash muscle memory.
You also can get the git branch in bash, and a bunch of other $PS1 customizations are also possible (Tmux, ssh, time, background processes, etc).
I’ll try the up completion later :)
yeah you can do anything in bash….
zsh is really just an extension of bash, imo…
but the completion alone makes it worth it for me.
also colors in the terminal
Ctrl + R and start typing the command, it’ll come up, press enter. Im just more lazy because I know there are still faster ways.
Edit: instead of hitting enter, keep pressing ctrl + R to cycle through history commands that contain what you typed in
Note: if the above isn’t working, you may need to first set your shell to accept emacs commands:
set -o emacs
Oh my freaking god thank you
Fuck that hits so hard.
Care to explain to an uninitiated?
Every time you hit the up arrow, it shows the previous command you used in the terminal.
So hitting the arrow once gives your last used, hitting it twice gives your second to last command, and so on.
Yup and that is me. I could just history grep the command I want but I SWEAR it was just 2 commands ago, or 15 up arrows. lol.
Ohhh! I can absolutely relate to this as well! Using a zmud client to play games on. which is probably not much different, looking, than a terminal anyways
Multi user dungeon? What do you play?
Did. It’s long gone
Was a modified circlemud. Mostly fantasy. Was a mish mash of popular fantasy worlds. Feist, Tolkien, various DnD settings, letter on they tried to go away from fandom content.
Had any 29 classes, could “remort” keeping 15% of your skills. And had other benefits such as lowering some level requirements here and there.
Was riftsmud.net:4000 originally but they ended up having to move a could times.
About 40 players at peak times, maybe 100 players altogether that played any amount
You’re in vim, you forgot to sudo, the file is read only and you have loads of changed you don’t feel like saving off to /tmp and playing the copy file shell game.
[esc]:w !sudo tee %
it shoves the current buffer through tee (termina adapter) with sudo privs vim will warn you that the file changed, just [esc]:q! and don’t let it save, you already saved it.
I don’t see how this is relevant but thanks for the tip.
I offered one for !ssh, then noticed people were giving other obscure tips so i offered this one.
!ssh
run the last command that started with ssh
I… Well… Thank you !
It’s as amazing as it is dangerous :) use with care!
… And waste an opportunity to type on my ludicrously expensive mechanical keyboard?
FRIG no
Ah crap how did I set my battery charge interval again?
history | grep battery
history | grep bios
history | grep sudo smbios
Ah! There you are you little shit!
edit to add: Actually, I think the last time I did this I remembered some numbers I set it to before. So it worked well with something like “history | grep 75” even though there were a bunch of results.
Is there a good way to do this when you use a lot of terminal tabs and aren’t sure which tab you used for the command you’re looking for?
if you close all the terminal tabs and do ctrl+r on a new one it will search all of the ones you closed
Why are you making personal attacks against me.
Ctrl + p is the way.
Guilty!
Nah just save all your commands in a text file on the desktop then make an alias to open it in nano so you just have to type “com”. Works for dumb ol me
Why not just make the alias command cat the file instead?
Edit: I wrote grep instead of cat
I’ll look into that
I see so many people loving on atuin in the comments but I just tried it and don’t get it. It seems so much worse than the built in search. I guess it’s not for me.
I’ve been using it for a few months, and so far it’s not as good as just regular old command history. I think any benefit might be for really, really old commands, or commands happening in a specific location. So, I’m going to keep using it to see if it helps then. But, so far it’s a massive downgrade.
Ctrl+R
I’m not going to say how long I used linux before learning this. It isn’t “this many days old”, but it may as well be.
I have 7 headless linux boxes running.
Wait till you learn about
!?
.^r is superior, though.
Hey! I’ve seen you before! You’re the unhinged jackass noticer!
…i looked in your comment history for too long to figure out why though. https://lemmy.world/comment/18001123
This but with FZF and
ag
https://atuin.sh/ Does all that and a lot more, like showing if the command succeeded and which directory it was run in
Even quicker with zsh or atuin: write the first few letters then arrow up to cycle through all matches
I main ZSH and I’ve been CTRL+R’ing for years damn here I am a fool
Glad to be of service
This is what I love about Linux - always learning new things!
I like to imagine someone added it in for their own personal use and told nobody because surely they are the only one.
I’m shocked how far I had to scroll down before it was mentioned, I was getting scared I would have to say it lol
I love this one but is the gif moving at 0.5 frames a second or is it just me
Normal for me. Thanks for pointing out it was a gif. I never realize they’re gifs because I have to “open in external” for them to actually move.
It works fine for me if I click on it but the embedded one is stuttering.