siempre lo hago
siempre lo hago


siempre lo hago
You're viewing a single thread.
history | grep [the thing]
CTRL+R [the thing]
please i beg you
with grep I see all the alternatives, Ctl+R just shows me one
For me ctrl-r
is faster most of the time, history | grep [command]
is better if I can't easily pattern match (don't remember it exactly, using several flag variations, etc.). they're both good tools.
Combine ctrl+R with fzf and get the best of both worlds
You can press up
seeing multiple at the same time is more helpful though
Ppsshh. Not lazy enough. Create that in a script and call it "hgrep" and drop it into path.
Why not just use an alias?
That's the right way, yes.
Brilliant
i was doing cat ~/.bash_history | grep thing
which is stupid so i started doing grep "thing" ~/.bash_history
now you're telling me i should do history | grep thing
i can't win
Some would call the former command cat abuse.
In short, unless you want the contents of a file printed to stdout (or multiple files concatenated), the command can probably be written without cat
, instead using the filename as an argument (grep pattern file
) or IO redirection (cmd < file
).
Stylistics and readability are another thing though.
Some would call the former command cat abuse.
it 100% is, its just a bad habit of mine
Exactly! Now copy paste it into Joplin where you'll never see it ever again.