I typed it once, I'm not typing it again
Programmer Humor
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
Fish once again undefeated. If I want to find that weird image magick command I used earlier with foo.png in it I just type foo.png
, hit up and its usually the first one. It doesnt matter where foo.png occurs in the command, fish will find it.
I've been using ctrl + R
more now :3.. though I definitely used to ↑↑↑↑↑↑↑
Woah Ctrl R looks super cool, never knew that I could do that before…
check out fzf (install fzf and add (assuming bash) eval "$(fzf --bash)"
to your .bashrc)
Makes ctrl+r a superpower
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.
...until you press up one too many times and enter the same command but with a typo. Again.
Been there, done that.
Ctrl R
holy fucking shit 🤌💪🤯❤️💯
The number of people who don’t reverse-I-search is too damn high
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.
why not history | grep -i
and the search term?
even if there are several, you can use ! and the command's line number to run it again
history
is shell dependent.
CTRL+R for those unitiated
I’ve probably done that for ls
taptaptaptap.... taptaptaptap.... taptaptaptap taptaptaptap taptaptaptap
.... taptaptaptap
... tap ...
... shit I was on a different user when I typed it.
O(n) access, very efficient.
No, I do not care to share the value of n
Relevant xkcd: https://xkcd.com/1168/
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
Or, just type the command “history”, find the index number of the desired command, then type “! ”, then .
That's way more mental effort than pressing up a bunch of times.
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.