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

Re: Hard-Link Question



Le vendredi 04 août 2006 à 19:31 +0200, Matus UHLAR - fantomas a écrit :
> On 04.08.06 13:09, Raphael Brunner wrote:
> > I have a program (pdumpfs) that create as incremental-backup allways
> > hardlinks to the original-files. Thats great, but if I want to watch how
> > much space a backup need, then I can't see if the file is the original
> > or a new one.

(Sorry, I din't keep the original post, to which I want to answer)

You can simply look at the second column in ls -l, which tells you how
many names the file has. In your case, if it's >=2, then the entry is a
hardlink to a former version.

Example: 
thibaut@a-wing:~/testln$ touch a
thibaut@a-wing:~/testln$ touch b
thibaut@a-wing:~/testln$ ln b c
thibaut@a-wing:~/testln$ ls -l
total 0
-rw-r--r--  1 thibaut thibaut 0 2006-08-05 13:55 a
-rw-r--r--  2 thibaut thibaut 0 2006-08-05 13:55 b
-rw-r--r--  2 thibaut thibaut 0 2006-08-05 13:55 c

In essence, to know what files are new, I would do something like
 ls -Rl | grep "1 thibaut thibaut".

T.



Reply to: