alias_qr_rainmaker@lemmy.world to linuxmemes@lemmy.world · 6 days agocat posttitle.txt | grep memelemmy.worldimagemessage-square52linkfedilinkarrow-up1367arrow-down15
arrow-up1362arrow-down1imagecat posttitle.txt | grep memelemmy.worldalias_qr_rainmaker@lemmy.world to linuxmemes@lemmy.world · 6 days agomessage-square52linkfedilink
minus-squareexpr@programming.devlinkfedilinkarrow-up20·edit-26 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-up2·3 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.