bug-fileutils
[Top][All Lists]
Advanced

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

Fwd: Re: the files listed with du -a do not match ls -R, possible bug?


From: Aaron Wegner
Subject: Fwd: Re: the files listed with du -a do not match ls -R, possible bug?
Date: Mon, 26 Aug 2002 16:10:16 -0500
User-agent: KMail/1.4.1

Subject: Re: the files listed with du -a do not match ls -R, possible bug?
Date: Mon, 26 Aug 2002 15:54:45 -0500
From: Aaron Wegner <address@hidden>
To: Jim Meyering <address@hidden>

> I'm pretty sure that's not caused by a bug in du.
>
> Don't depend on the last `field' of each line of ls -lR output
> being the file name.  That's not true for symlinks.
> If you want to find all files with the .op suffix, just use `find',
> e.g., like this:
>
>   find . -name '*.op'

Well, I did one more experiment, and I found another instance of the bug.  I
went to my /usr directory, which is just a large directory on my machine,
about 1.9 GB.  I typed the following commands.

# find . | sort > findlog
# du -a | awk '{printf("%s\n", $2)}' | sort > dulog
# sdiff -s dulog findlog > difference

The file difference is 2245 lines long, with every line except one containing
a '>' indicating that the line is in the findlog but not in the dulog.

The one exception is a '|' on one line:

./share/config/colors/40        |       ./share/config/colors/40 Colors

Apparently find didn't get the whole "40 Colors" filename since it has a
 space in it, but that's off the topic.

The other 2244 lines are files that were found by 'find' but not by 'du'.

Some such files are:
> ./share/man/man3/3DBorder.3.gz
> ./share/man/man3/AddErrInfo.3.gz
> ./share/man/man3/AddOption.3.gz
> ./share/man/man3/Alloc.3.gz
> ./share/man/man3/AllowExc.3.gz

So, I went into the directory /usr/share/man/man3, and I entered the
following:

# du -a | grep AddErrInfo
# ls | grep AddErrInfo
AddErrInfo.3.gz
#

It appears that du -a is not finding files that 'find' and 'ls' find.  Also,
sometimes du -a will only list files if I am in the directory.  Such is the
case with

/usr/share/zoneinfo/US

which has 12 files.

If I go up one directory to

/usr/share/zoneinfo

du -a doesn't find any of the 12 files.





reply via email to

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