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 superpower
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 delete
But I still use fzf because while I used to do the above, fzf offered more advantage that made switching worth it.
Ctrl + r with fzf and you’ll never go back.
...until you press up one too many times and enter the same command but with a typo. Again.
Been there, done that.
The number of people who don’t reverse-I-search is too damn high
CTRL+R for those unitiated
reverse-i-search + fzf = <3
^r
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!
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.
Or "shit, I did in tmux last time so I could close the terminal window."
Relevant xkcd: https://xkcd.com/1168/
tar -xvf
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
tar --help
O(n) access, very efficient.
No, I do not care to share the value of n
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.
or Ctrl+R then search? I don't know why some people still bother with history
tbh.
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 typed it once, I'm not typing it again
Substring completion on ZSH. Type in a small part of the command you want to find and then press up.
In fish
, you can enter part of the command, and then press up to search for it. It's kinda awesome.
also when they see this post
You have to be a linux user to use the console now?
Wow this is really validating for me to read. I’ve been using Linux for a few years but I’m definitely not a computer expert and am intimidated by the command line.
I’ve always felt like googling every command and arrowing up to find an old entry rather than just googling it again marked me as a fake Linux user, not a real one.
Lol don't feel bad, I can do advanced crazy shit with Linux like pivoting the running OS into RAM so I can unmount the boot drive to do whatever without ever rebooting
But I still [Web Search] commands a shit ton of the time LMAO
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