I’ve been using
ctrl + Rmore now :3… though I definitely used to ↑↑↑↑↑↑↑- 9 months
check out fzf (install fzf and add (assuming bash)
eval "$(fzf --bash)"to your .bashrc) Makes ctrl+r a superpower- aquovie@lemmy.cafeEnglish9 months
It’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 deleteBut 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
sbeak@sopuli.xyzEnglish
9 monthsWoah Ctrl R looks super cool, never knew that I could do that before…
…until you press up one too many times and enter the same command but with a typo. Again.
- 9 months
There is an option you can set in .zshrc or .bashrc which only includes lines that exit 0 (success)
- 9 months
Infuriatingly that would omit things like unit test runners from the history in case they don’t pass. As a developer I tend to re-run failed commands quite often, not sure how widely that applies, though.
- ulterno@programming.devEnglish9 months
Oh, stuff like
git diffandgit logwill end up being omitted pretty often.
And a lot of times, the commands that end with piping intoless
- ulterno@programming.devEnglish9 months
It was quite a while before I realised that was possible.
Then not long after starting to use it, that I got fed up and just started opening up the history file and searching in it.- 9 months
why not
history | grep -iand the search term?even if there are several, you can use ! and the command’s line number to run it again
- 9 months
Ctrl-r, l ctrl-r, ctrl-r, ctrl-r, ctrl-r, ctrl-r, ctrl-r, ctrl-r, ctrl-r. To get ls.
- 9 months
No way! I didn’t know you could cycle through the results like that… awesome!
- 9 months
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.”
- 9 months
O(n) access, very efficient.
No, I do not care to share the value of n
- 9 months
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 does- 9 months
i just use unar (unarchive) nowadays, since that works with all file formats iirc
- bitchkat@lemmy.worldEnglish9 months
Extract a tarball with verbose output from the specified file.
And learn how to use the ‘z’ option
IsoKiero@sopuli.xyzEnglish
9 monthsUnfortunately 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
- psud@aussie.zoneEnglish9 months
tar -jcvf archive.tbz ~/stuff/*
Of course I don’t know the bomb had bzip2 on it… I wonder if we can start with ls to see if there’s anything to tar or untar
- 9 months
Or, just type the command “history”, find the index number of the desired command, then type “! <index number>”, then <enter>.
- Frezik@lemmy.blahaj.zoneEnglish9 months
That’s way more mental effort than pressing up a bunch of times.
Eager Eagle@lemmy.worldEnglish
9 monthsor Ctrl+R then search? I don’t know why some people still bother with
historytbh.- 9 months
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.
- 9 months
https://github.com/atuinsh/atuin is a great tool to manage and search your shell history. I especially enjoy it being able to search commands based on the working directory I was in when I ran them.
It also has more features (which I don’t use) to manage dotfiles and sync shell history across hosts/devices.
I was going to talk about it too ! Even though I’m on fish (which helps a lot with history search) atuin really changed my habits and made my life easier !
- 9 months
Substring completion on ZSH. Type in a small part of the command you want to find and then press up.
- 9 months
In
fish, you can enter part of the command, and then press up to search for it. It’s kinda awesome.- rozodru@piefed.socialEnglish9 months
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.
- 9 months
That’s what I do in bash except for pressing up it’s ctrl+r. FZF does the fuzzy finding for me. It’s so convenient.
- UnfortunateShort@lemmy.worldEnglish9 months
fish has “directory-aware” autocomplete with inlay hints and a fantastic
historycommand. I do not suffer from such weakness








