Skip to main content
4 of 4
added 13 characters in body
Stéphane Chazelas
  • 584.8k
  • 96
  • 1.1k
  • 1.7k

Calculating directory size without subdirectories bind-mounted from the same device

I want to calculate a directory size with all its subdirectories. But I had made some of the subdirectories to mount from a mount point. (using mount -B/--bind)

when I use du -hks the returned size includes the mounted directories. Is there a way to eliminate their size from the result?

Edit: The Directories I calculate size are all in the same location. There is a Main directory with shared content for all other directories (This contains all the mount points) and Directories have some individual files. The goal is to calculate the individual files size.