I have a bash script that needs to know the number of bytes for all gzip files in a directory. So far I assume that this is only one directory without subdirectories. It is very tempting to do something like this:
du -scb /my/dir/*.gz|tail -n 1
However, I have TON files. Would *.gzit not expand to any overflow condition? Is there a faster and safer way to check this number?
User1 source
share