alias_qr_rainmaker@lemmy.world to linuxmemes@lemmy.world · 6 days agocat posttitle.txt | grep memelemmy.worldimagemessage-square50linkfedilinkarrow-up11arrow-down10
arrow-up11arrow-down1imagecat posttitle.txt | grep memelemmy.worldalias_qr_rainmaker@lemmy.world to linuxmemes@lemmy.world · 6 days agomessage-square50linkfedilink
minus-squareexpr@programming.devlinkfedilinkarrow-up0·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-up0·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.