How can I see a folder's exact size in bytes?

Use the -B1 parameter to du:

du -s -B1 foldername
$ man 1 du
 -B, --block-size=SIZE
          use SIZE-byte blocks

You could also try the --apparent-size flag


du - estimate file space usage

-B, --block-size=SIZE
          scale sizes by SIZE before printing them.  E.g., '-BM' prints sizes in units of 1,048,576 bytes.  See SIZE format below.

-b, --bytes
          equivalent to '--apparent-size --block-size=1'

For Example,

user$ du -B1 filename

du -sb foldername

seems to do the trick

Tags:

Folder