SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2007
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Folder size excluding hard links

    Short version:
    I want to get the sum of file sizes in a folder excluding hard links.

    Long version:
    I have a bunch of folders with a bunch of files. A lot of the files are hard linked amongst themselves (these files were created via rsnapshot). I want to get the actual size occupied by the files. Seems like du counts each hardlink as the size occupied by the destination file, so I get a bloated result. Also, du doesnt seem to have an option to exclude hard links.

    Any ideas on how to do this?

    Thanks a lot!

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2010
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try "du -ah --max-depth=1". It will show 0 size for links so your total size will not be affected.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •