Ten-character #Linux or #Unix command? Pshaw! Real Linux and Unix wizards summon their magic spells by mashing the up arrow a thousand times. It's the ancient ritual of command-line mastery. Lmao.
Definitely not lazy

@nixCraft !searchstring:p then up arrow + enter 😆 or, if one is really positive, !searchstring alone
@nixCraft he could have typed ctrl-r then ls to find it quickly.
@nixCraft why would you call me out like that
@nixCraft ofc im not willing to write something twice, am i stupid? I'll search for the command for 20 minutes
@nixCraft dude why not just use "history" command? XD
I mean I can see why if it's on tty or such
@nixCraft For me it's more like "C-r ls" to find ls in my history, wayyy less typing that up up up up up up up up up :D
@nixCraft Alright, someone needs to learn about history|grep and ctrl-r

@nixCraft Again a faux CLI hacker. This avoids retyping the command, and it still works if the command is not in the history:

$((history | grep --only-matching ls || echo ls) | head --lines 1) 😅

@nixCraft love it!!!! that's how it works :)
@nixCraft Who uses arrow? Put set -o vi in your profile then it's simply /mycommand return. Maybe hit a few ns to get the exact one.
@nixCraft Once I learned about CONTROL-R in bash and zsh, I no longer needed the up arrow key as much.
@nixCraft This is not really true. People use ctrl R.
@nixCraft Ctrl-r is the foundation of my command line wisdom.
@nixCraft alright kids, let me tell you about Ctrl-R
@nixCraft also, I know there is some 'history search' function, but I just never took the time to learn how it works lol
@nixCraft sunk cost fallacy in action. 😅

@nixCraft

People who know Ctrl+R when they hear that you can type
cd */*/baz
to go to
cd foo/bar/baz

@nixCraft I will have to cancel all projects the day my command line history is cleared for any reason
@nixCraft How about using CTRL + R? 😂

@nixCraft
set -o vi
Your command line is now in Vim or actually in ed mode!

Been doing it for the past 30+ years and will never graduate from it.

@nixCraft I write all my old commands in charcoal on the wall of my fireplace. I know them by hearth.

@nixCraft
I mostly do
cat ./.bash_history | grep "stuff".

I know about the history command but it sometimes doesn't back far enough.

Reading the comments, I might want to try ctrl+r now too

@nixCraft pressing the up arrow 999 times then Ctrl-r
@nixCraft

I remember the first time I said to myself "I can't believe I just did that" when I did "!ls" to get an "ls".

@nixCraft Let me help you with this.

Make a file called ~/.inputrc with the following contents

set completion-ignore-case on

"\e[A": history-search-backward

"\e[B": history-search-forward

set show-all-if-ambiguous on

-- end of file ---

Logout and then log back in.

Then you can type the first letter of any previous command, and then, hit the Up Arrow key.

It will scroll through previous commands beginning with the what you typed.

One less key than Ctrl-R :)

@nixCraft doesn't matter how well you know a command if you can't spell it

@nixCraft this is why I default to #PowerShell as my shell on every OS. The predictor system is awesome!

https://learn.microsoft.com/en-us/powershell/scripting/learn/shell/using-predictors?view=powershell-7.4

Using predictors in PSReadLine - PowerShell

This article describes the features and usage of Predictive IntelliSense in PSReadLine.

@nixCraft Or just use CTRL+r and use the fzf command search feature in zsh. Best thing I discovered so far using the terminal
@nixCraft Sounds like a job for Antuin https://atuin.sh/
Atuin - Magical Shell History

Sync, search and backup shell history with Atuin