alias_qr_rainmaker@lemmy.world to linuxmemes@lemmy.world · 3 days agocat posttitle.txt | grep memelemmy.worldimagemessage-square50linkfedilinkarrow-up1360arrow-down15
arrow-up1355arrow-down1imagecat posttitle.txt | grep memelemmy.worldalias_qr_rainmaker@lemmy.world to linuxmemes@lemmy.world · 3 days agomessage-square50linkfedilink
minus-squareexpr@programming.devlinkfedilinkarrow-up19·edit-23 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-21 day 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.