cm0002@lemmy.world to Programmer Humor@programming.dev · 2 days agoLinux Userslemmy.mlimagemessage-square141fedilinkarrow-up11.01Karrow-down117
arrow-up1995arrow-down1imageLinux Userslemmy.mlcm0002@lemmy.world to Programmer Humor@programming.dev · 2 days agomessage-square141fedilink
minus-squareHammerheart@programming.devlinkfedilinkarrow-up8arrow-down1·2 days agocat ~/.bash_history | grep
minus-squareHammerheart@programming.devlinkfedilinkarrow-up2·16 hours agoYes, it was meant to be a self deprecating admission that I have used this unnecessarily verbose command.
minus-squareechindod@programming.devlinkfedilinkarrow-up1·7 hours agoAh. Well. I can not be blameless on this. I also probably use cat unnecessarily still. But less so with grep these days. I’m getting better… I swear!
minus-squaredisobey2623@lemmy.dbzer0.comlinkfedilinkarrow-up2·2 days agoYou saying I can just skip cat in that command and it works?
minus-squareulterno@programming.devlinkfedilinkEnglisharrow-up0·1 day agoMy output was empty for that command. Guess why? Because history only gives the last few lines in my system.
minus-squaredisobey2623@lemmy.dbzer0.comlinkfedilinkarrow-up4·2 days agoHow did I not know this. Thank you!
minus-squareoozynozh@sh.itjust.workslinkfedilinkarrow-up1·1 day agoit’s grep STRING FILE to be precise or awk '/STRING/′ FILE if you prefer that for some reason
cat ~/.bash_history | grep
Useless use of cat?
Yes, it was meant to be a self deprecating admission that I have used this unnecessarily verbose command.
Ah. Well. I can not be blameless on this. I also probably use cat unnecessarily still. But less so with grep these days. I’m getting better… I swear!
You saying I can just skip cat in that command and it works?
history | grep 'cat'
My output was empty for that command.
Guess why?
Because
history
only gives the last few lines in my system.How did I not know this. Thank you!
it’s
grep STRING FILE
to be preciseor
awk '/STRING/′ FILE
if you prefer that for some reason