[GH-ISSUE #158] Size of symlinked files rather than size of symlink #68

Closed
opened 2026-06-08 11:25:32 +03:00 by zhus · 5 comments
Owner

Originally created by @wdecoster on GitHub (Jul 9, 2021).
Original GitHub issue: https://github.com/bootandy/dust/issues/158

Hi,

Great tool! I found this on https://github.com/ibraheemdev/modern-unix and want to use it on my system.

I am not sure if this is related to #157, but I noticed that dust also counts the file size of the file to which a symlink is pointing, rather than the size of the symlink.
For a directory with symlinks to pretty large files on another filesystem dust reports 22T, while du just returns 46M.
If I am looking in my home directory for things that use disk space I am not so much concerned about things that actually live on the huge storage server.

Is there already a switch to turn this off? Or is this the intended behavior?

Thanks,
Wouter

Originally created by @wdecoster on GitHub (Jul 9, 2021). Original GitHub issue: https://github.com/bootandy/dust/issues/158 Hi, Great tool! I found this on https://github.com/ibraheemdev/modern-unix and want to use it on my system. I am not sure if this is related to #157, but I noticed that dust also counts the file size of the file to which a symlink is pointing, rather than the size of the symlink. For a directory with symlinks to pretty large files on another filesystem `dust` reports 22T, while `du` just returns 46M. If I am looking in my home directory for things that use disk space I am not so much concerned about things that actually live on the huge storage server. Is there already a switch to turn this off? Or is this the intended behavior? Thanks, Wouter
zhus closed this issue 2026-06-08 11:25:32 +03:00
Author
Owner

@bootandy commented on GitHub (Jul 9, 2021):

Thanks,

Are the links soft links or hard links?

If they are soft links I think that is a bug, I did a large refactor recently and if you run dust on a directory tree with soft links pointing to outside that directory tree then it takes the size of the file instead of the size of the symlink.

<!-- gh-comment-id:877130438 --> @bootandy commented on GitHub (Jul 9, 2021): Thanks, Are the links soft links or hard links? If they are soft links I think that is a bug, I did a large refactor recently and if you run dust on a directory tree with soft links pointing to outside that directory tree then it takes the size of the file instead of the size of the symlink.
Author
Owner

@wdecoster commented on GitHub (Jul 9, 2021):

Those are soft links. So yes, the soft links point to another file system and thus outside the directory tree.

<!-- gh-comment-id:877138515 --> @wdecoster commented on GitHub (Jul 9, 2021): Those are soft links. So yes, the soft links point to another file system and thus outside the directory tree.
Author
Owner

@AckslD commented on GitHub (Jul 14, 2021):

Is it possible to tell it to report the size of the symlink even if they are outside the directory tree with some argument?

<!-- gh-comment-id:879869762 --> @AckslD commented on GitHub (Jul 14, 2021): Is it possible to tell it to report the size of the symlink even if they are outside the directory tree with some argument?
Author
Owner

@bootandy commented on GitHub (Jul 15, 2021):

This is a bug. I will fix it.

<!-- gh-comment-id:880626799 --> @bootandy commented on GitHub (Jul 15, 2021): This is a bug. I will fix it.
Author
Owner

@bootandy commented on GitHub (Jul 19, 2021):

fixed in v0.6.1

<!-- gh-comment-id:882535947 --> @bootandy commented on GitHub (Jul 19, 2021): fixed in v0.6.1
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#68