Subject: Bug of stat in bash
From: Arturo <[email-masked]>
To: "[email-masked]" <[email-masked]>
Date: Wed, 13 Jan 2016 15:14:04 +0000 (UTC)
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi.
I've needed isolate the size of a directory writing a script. I've used "stat -c %s directory", but the result is a great surprise. You can view the image stat.jpg: the size of /var/cache/apt/archives is 9804 KB (10 MB aprox.), but stat shows "159744". This number is the same if the directory have 60 MB, 10 MB or 0 MB. In other equal instalation (Ubuntu 14.04) this number showed 4096 with more than 300 MB in the same directory.
In the stat2.jpg image you can view the same situation with the directory empty.
It's a bug? The way to obtain my goal (only the number) is another? I've read the manual of stat and I can't discover another way. Reading pages in Internet, this is the way explained to achieve my goal...My system: Ubuntu 14.04; Terminal: Gnome 3.6.2.
Thanks for your attention.                                           Arturo