It’s too early to call me out like that.
zsh-history-substring-search
I lazily type part of the thing I want like “sys” and then ctrl+⬆️/⬇️ and
sudo systemctl start libvirtdetc. appear like magic.Why are you making personal attacks against me.
More like ⬆️⬆️⬆️⬆️⬆️⬆️ mother fucker ⬇️
⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️⬆️
CTL+C
history
history | less
⬆️⬆️⬆️
Pg-up
…
Pg-up
…
q
! 2648
history 500 | grep *snippet of command*
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 everyone posting about Ctrl+R, here’s a couple more useful CLI shortcuts you might enjoy:
cd - (change directory to $OLDPWD usually the previous directory)
git checkout - (similarly checkout the previous branch)
Ctrl+A (return caret to beginning of command, great when you forgot a positional argument and you were almost done typing the command)
Ctrl+E (similar to Ctrl+A but move to the end of the command)
Ctrl+A, Ctrl+E
Many more basic Emacs keybindings work, actually! Including C-f, C-b, C-p and C-n (if you prefer them over arrow keys) as well as M-f and M-b to move by words, C-k, M-d and C-y for killing/yanking (but not M-w) and C-SPC, C-w, C-x C-x for region manipulation (tested in Bash and ZSH)
Ctrl+L to clear the terminal screen, instead of typing clear
Also Ctrl-u to clear the command line.
Not super into that since I’ve found all it does (at least in zsh) is print a bunch of blank lines
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.
Note: if the above isn’t working, you may need to first set your shell to accept emacs commands:
set -o emacsOh my freaking god thank you
Or just use fish shell. Rarely need ctrl+r anymore.
I’m familiar with fish shell, but what specifically makes you like it?
fellow fish user, I just like its autocomplete and how I can just type ‘help’ and an interactive HTML page opens up where I can look stuff, and fish_config does the same except with settings and themes
Context-based autocomplete is the main selling point for me.
You know the one command I hate? CTL vs CTRL. There is no damned consistency I can see. Is it systemctl reboot or systemctrl reboot?
i’ve literally never seen ‘systemctrl’? it’s always ctl for the command-line utilities
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
I used to be like this but people seriously. CTRL+R
Do it. Don’t make this one of those things you’ve heard about and just never got around to trying. Open your terminal right now and CTRL+R and type any part of the command you did before. If it’s not showing first just hit CTRL+R again to go to the next one back.
DO IT.
Edit: I did learn from this thread today though that ZSH has it set to where you can just type part of what you’re looking for then hit up to do the same thing. Neat!
Fish too, it’s fantastic.
CTRL+R + FZF is the goat. You just need to vaguely remember the command and you’ll find it.
WHAT THE FUCJ IS THIS SORCERY BRO I’VE BEEN USING LINUX FOR AGES AND NEVER KNEW THIS BROOOOOOOOOO
You can empower Ctrl+r event more by using fzf. After I started using it, I can’t imagine going back to without it.
If you want to level up ctrl-r, upgrade to Atuin: https://atuin.sh/
If I haven’t ran it in a while or I don’t know it by heart then I ‘nano /home/mehblah/.bash_history’
I do
history | grep keyword.I forget that exist. One problem with being really old school on linux is you don’t adopt new ways unless there is a reason to do so.
… And waste an opportunity to type on my ludicrously expensive mechanical keyboard?
FRIG no












