Skip to main content
3 of 4
edited title
Stéphane Chazelas
  • 584.9k
  • 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") when I use "du -hks" the returned size includes 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.