Nathan (gemsling) wrote,
Nathan
gemsling

Unix: du and hard links

If there's no distinction between multiple hard links pointing to a single file (i.e. the second link to a file is exactly the same as the first), how does du give different results?
3.1G	./pecan.1
 20M	./pecan
 75M	./pecan.2
198M	./pecan.week1

EDIT: Don't you hate it when you answer your own question immediately, leaving no point posting? Running du -hd0 pecan gives 3.1G, whereas above that size was shown against pecan.1 (the first entry). Conclusion: du is only counting each file once, ignoring files that have already been included elsewhere.
Tags: rsync.net, tech
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments