Re: basic find sorting behavior
- From: Michael Tosch <eedmit@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 06 Dec 2006 16:31:43 +0100
Jeff wrote:
This is a very basic question about find. I have 4 directories (a, b ,c, d)
without files under. When I issue "find . -type d", the output is "c, a, b,
d". I would like to understand why it is sorted this way considering that
the directories were created the same day with the following time:
mtime ctime atime
./c 8:17:55 8:17:55 8:43:35
./a 8:17:50 8:17:50 8:43:35
./b 8:17:53 8:17:53 8:43:35
./d 8:43:34 8:43:34 8:43:35
Thanks
jeff
find uses the getdents() system call to read the directory.
man getdents
The order given by getdents() depends on the file system.
It can be in the order the files are created,
or it can be a quasi-random order (due to some hash algorithm).
--
Michael Tosch @ hp : com
.
- Follow-Ups:
- Re: basic find sorting behavior
- From: Jeff
- Re: basic find sorting behavior
- References:
- basic find sorting behavior
- From: Jeff
- basic find sorting behavior
- Prev by Date: Re: Extract runtime from logfile
- Next by Date: Bash: extract first 'word' from array
- Previous by thread: Re: basic find sorting behavior
- Next by thread: Re: basic find sorting behavior
- Index(es):
Relevant Pages
|