Does ‘du’ command count the size of unaccessible folders

disk-usagepermissions

I am trying to get the size of an user's folder named allysek and I am using this command du -hLlxcs allysek. I know I don't have permissions to some of the locations.

In the end, I get an output as follows,

du: cannot access ‘/export/mite-09/bc/users/allysek/charlet/PS-tools-mjyger/PS-NOVA/IMR90.NOMe-seq.bam’
du: cannot access ‘/export/mite-09/bc/users/allysek/charlet/PS-tools-mfter/PS-NOVA/IMR90.NOMe-seq.bam.bai’
du: cannot access ‘/export/mite-09/bc/users/allysek/charlet/PS-tools-iuhgi/PS-NOVA/colon.WGBS.bam’
du: cannot access ‘/export/mite-09/bc/users/allysek/charlet/PS-tools-kh/PS-NOVA/colon.WGBS.bam.bai’
du: cannot access ‘/export/mite-09/bc/users/allysek/charlet/PS-tools-h/PS-NOVA/dbNOVA_135.hg19.sort.vcf’
du: cannot access ‘/export/mite-09/bc/users/allysek/charlet/PS-tools-master/PS-NOVA/hg19_rCRSchrm.fa’
du: cannot access ‘/export/mite-09/bc/users/allysek/charlet/PS-tools-master/PS-plot/DKO1.NOMe-seq.bam’
du: cannot access ‘/export/mite-09/bc/users/allysek/charlet/PS-tools-master/PS-plot/DKO1.NOMe-seq.bam.bai’
896M    /export/mite-09/bc/users/allysek
896M    total

So my question is, does the 896M total include sizes of items which I wasn't able to access as well?

Best Answer

Simply not. Look this example

du -shc *
4,0K    AUDIO_TS
4,4G    VIDEO_TS
4,4G    total
chmod 000 * #don't use this in wrong dir!
du -shc *
du: cannot read directory 'VIDEO_TS': Permission denied
du: cannot read directory 'AUDIO_TS': Permission denied
4,0K    AUDIO_TS
4,0K    VIDEO_TS
8,0K    total