- cross-posted to:
- programmerhumor@lemmy.ml
- cross-posted to:
- programmerhumor@lemmy.ml
I’ve been using
ctrl + R
more now :3… though I definitely used to ↑↑↑↑↑↑↑check out fzf (install fzf and add (assuming bash)
eval "$(fzf --bash)"
to your .bashrc) Makes ctrl+r a superpowerIt’s awesome until you want to put the cursor in a specific spot of a previous command.
$ rm -f delete-me.txt ctrl-r "me", ctrl-b, ctrl-k $ rm -f delete
But I still use fzf because while I used to do the above, fzf offered more advantage that made switching worth it.
I’ll try it if I don’t forget it by the next time I have access to my PC lol :3
Ctrl + r with fzf and you’ll never go back.
or documentation.To use ctrl-r I have to remember something about the command. To use up arrow I just have to know about how many commands ago I used it.
Not if you have fzf you don’t: https://github.com/junegunn/fzf
Like an interactive fuzzy finding history. It’s sick.
I knew there was an
ls
In there somewhere
ctrl + r, l, s
Much faster than simply typing
ls
!Now I don’t have to type that in again. Phew!
ls … enter ↑ enter ↑ enter
You may consider using
watch ls
I do like that, thanks a lot ulterno!
…until you press up one too many times and enter the same command but with a typo. Again.
Been there, done that.
^r
and whenever you forget to sudo:
sudo !!
You need this: https://github.com/nvbn/thefuck
Ctrl-r, l ctrl-r, ctrl-r, ctrl-r, ctrl-r, ctrl-r, ctrl-r, ctrl-r, ctrl-r. To get ls.
No way! I didn’t know you could cycle through the results like that… awesome!
It’s basically emacs incremental search.
The number of people who don’t reverse-I-search is too damn high
CTRL+R for those unitiated
reverse-i-search + fzf = <3
I’ve probably done that for
ls
O(n) access, very efficient.
No, I do not care to share the value of n
taptaptaptap… taptaptaptap… taptaptaptap taptaptaptap taptaptaptap
… taptaptaptap
… tap …
… shit I was on a different user when I typed it.
Or “shit, I did in tmux last time so I could close the terminal window.”
Or, just type the command “history”, find the index number of the desired command, then type “! <index number>”, then <enter>.
That’s way more mental effort than pressing up a bunch of times.
or Ctrl+R then search? I don’t know why people bother with
history
tbh.This is going to save me so much time pressing the up arrow.
Because you can pipe history to grep.
with fzf you get better grep with fuzzy search
Ctrl-R if you know part of the command.
Holy cow!! I didn’t know that. I have been using history > history.txt to find “that one command for that one thing” I only need once every other month or so. Thanks, now I can just do that.
Substring completion on ZSH. Type in a small part of the command you want to find and then press up.
bash supports this feature too btw
Added to my mental toolbox, thanks!
fish has “directory-aware” autocomplete with inlay hints and a fantastic
history
command. I do not suffer from such weaknessRelevant xkcd: https://xkcd.com/1168/
tar -xvf <archive-name>
but only because I had to look it up twice so now my brain has committed it to memory
I don’t even know what it doesi just use unar (unarchive) nowadays, since that works with all file formats iirc
Extract a tarball with verbose output from the specified file.
And learn how to use the ‘z’ option
tar - h
Unfortunately that’s not valid.
$ tar -h tar: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options Try 'tar --help' or 'tar --usage' for more information.
From man-page:
-h, --dereference follow symlinks; archive and dump the files they point to
Damn.
Thanks, we all died.
:)
In
fish
, you can enter part of the command, and then press up to search for it. It’s kinda awesome.yeah I ONLY just recently switched to fish after using zsh and oh my zsh for so long - pretty much since first starting linux cause I once saw someone using it on unixporn and I thought “that’s cool”
when I switched to NixOS zsh with all the plugins was a total slog. switched to fish and it just HAS everything that zsh/oh my zsh and the various plugins had but baked in.
so yeah in Fish it’s just starting to type something and hoping it’s still in the history.
also when they see this post