coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: feature request du/find


From: Bernhard Voelker
Subject: Re: feature request du/find
Date: Wed, 30 Oct 2019 19:08:03 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2

On 10/30/19 5:01 PM, Benjamin Arnold wrote:
i was trying to determine the "real size" of a incremental backup
created with rsync and hardlinks. To be more specific: "how much space
will be freed if i delete this backup?"

I've got it working, but in a very sloppy way.

I wondered if it was possible and reasonable to add a feature to du or
find, so that one can include only files with inode counter = 1.

'du' doesn't count twice:

  $ mkdir d1 \
      && dd if=/dev/zero of=d1/x bs=1M count=20 status=none \
      && cp -al d1 d2

  $ ls -lihog d1/x d2/x
  805939 -rw-r--r-- 2 20M Oct 30 19:04 d1/x
  805939 -rw-r--r-- 2 20M Oct 30 19:04 d2/x

  $ du -shxc d1 d2
  21M   d1
  4.0K  d2
  21M   total

FWIW: find has a "-links N" option.

Does that answer your question?

Have a nice day,
Berny



reply via email to

[Prev in Thread] Current Thread [Next in Thread]