Use pipe with du to compute "size" of stdin Use pipe with du to compute "size" of stdin linux linux

Use pipe with du to compute "size" of stdin


You can pipe it to wc -c to count the number of bytes that goes through the pipeline.


du stands for "disk usage". Data in a pipe doesn't hit the disk, so there's no "du" to work with. use wc instead, which is "word count".

awk '$2>=10' < myfile | wc -c

The -c flag counts bytes.