cm0002@lemmy.world to Programmer Humor@programming.dev · 1 day agoLinux Userslemmy.mlimagemessage-square136linkfedilinkarrow-up11.19Karrow-down120
arrow-up11.17Karrow-down1imageLinux Userslemmy.mlcm0002@lemmy.world to Programmer Humor@programming.dev · 1 day agomessage-square136linkfedilink
minus-squareHammerheart@programming.devlinkfedilinkarrow-up9arrow-down2·22 hours agocat ~/.bash_history | grep
minus-squaredisobey2623@lemmy.dbzer0.comlinkfedilinkarrow-up2·15 hours agoYou saying I can just skip cat in that command and it works?
minus-squareulterno@programming.devlinkfedilinkEnglisharrow-up0·9 hours 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·15 hours agoHow did I not know this. Thank you!
minus-squareoozynozh@sh.itjust.workslinkfedilinkarrow-up2·10 hours 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?
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