alias_qr_rainmaker@lemmy.world to linuxmemes@lemmy.world · 4 days agocat posttitle.txt | grep memelemmy.worldimagemessage-square35fedilinkarrow-up1295arrow-down14
arrow-up1291arrow-down1imagecat posttitle.txt | grep memelemmy.worldalias_qr_rainmaker@lemmy.world to linuxmemes@lemmy.world · 4 days agomessage-square35fedilink
minus-squareexpr@programming.devlinkfedilinkarrow-up14·edit-24 days agocat file.txt | grep foo is unnecessary and a bit less efficient, because you can do grep foo file.txt instead. More generally, using cat into a pipe is less efficient than redirecting the file into stdin with <, like grep foo < file.txt.
minus-squareAjen@sh.itjust.workslinkfedilinkarrow-up1·edit-22 days agoAnd if you prefer the cat | grep ordering, < file.txt grep foo is also valid.
cat file.txt | grep foois unnecessary and a bit less efficient, because you can dogrep foo file.txtinstead. More generally, using cat into a pipe is less efficient than redirecting the file into stdin with<, likegrep foo < file.txt.And if you prefer the
cat | grepordering,< file.txt grep foois also valid.