bugfindutils - Bugs: bug #15167, find . -type d output is not in...

 
 

bug #15167: find . -type d output is not in order

Submitter:  None
Submitted:  Wed 07 Dec 2005 07:44:08 PM UTC
   
 
Category:  find Severity:  3 - Normal
Item Group:  Wrong result Status:  Invalid
Privacy:  Public Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  4.2.27
Fixed Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 08 Dec 2005 12:56:12 AM UTC, comment #1: 

Actually in your example the contents of the directory are not sorted.  Instead, ls is sorting them (ls is required to sort its arguments).  The find program, on the other hand, is not required to do this.  The find program just prints the filename in the order they are returned by the kernel.

Hence this is not a bug; find is doing what it is supposed to do.

James Youngman <jay>
Group administrator
Wed 07 Dec 2005 07:44:08 PM UTC, original submission:  

I have files located in directories that are sorted by date (YYYY-MM-DD) and when I do a find . -type d they are outputted randomly.

[dhammis@who Photos]$ ls
2005-09-11  2005-09-22  2005-10-03  2005-10-15  2005-10-30  2005-11-14
2005-09-12  2005-09-23  2005-10-05  2005-10-17  2005-10-31  2005-11-18
2005-09-13  2005-09-24  2005-10-06  2005-10-18  2005-11-01  2005-11-19
2005-09-14  2005-09-25  2005-10-07  2005-10-19  2005-11-02  2005-11-24
2005-09-15  2005-09-26  2005-10-08  2005-10-22  2005-11-03  2005-11-25
2005-09-16  2005-09-27  2005-10-09  2005-10-23  2005-11-06  2005-11-27
2005-09-17  2005-09-28  2005-10-10  2005-10-24  2005-11-07  2005-11-30
2005-09-18  2005-09-29  2005-10-11  2005-10-25  2005-11-08  2005-12-01
2005-09-19  2005-09-30  2005-10-12  2005-10-26  2005-11-11  index.html
2005-09-20  2005-10-01  2005-10-13  2005-10-27  2005-11-12  memstick.ind
2005-09-21  2005-10-02  2005-10-14  2005-10-28  2005-11-13  mstk_pro.ind
[dhammis@who Photos]$ find . -type d
.
./2005-11-30
./2005-11-30/thumbs
./2005-11-30/scaled
./2005-09-16
./2005-09-16/thumbs
./2005-09-16/scaled
./2005-09-17
./2005-09-17/thumbs
./2005-09-17/scaled
./2005-10-26
./2005-10-26/thumbs
./2005-10-26/scaled
./2005-11-18
./2005-11-18/thumbs
./2005-11-18/scaled
./2005-10-06
./2005-10-06/thumbs
./2005-10-06/scaled
./2005-10-12
./2005-10-12/thumbs
./2005-10-12/scaled
./2005-09-13
./2005-09-13/thumbs
./2005-09-13/scaled
./2005-10-13
./2005-10-13/thumbs
./2005-10-13/scaled
./2005-11-27
./2005-11-27/thumbs
./2005-11-27/scaled
./2005-11-07
./2005-11-07/thumbs
./2005-11-07/scaled
./2005-11-25
./2005-11-25/thumbs
./2005-11-25/scaled
./2005-11-03
./2005-11-03/thumbs
./2005-11-03/scaled
./2005-09-22
./2005-09-22/thumbs
./2005-09-22/scaled
./2005-10-28
./2005-10-28/thumbs
./2005-10-28/scaled
./2005-10-24
./2005-10-24/thumbs
./2005-10-24/scaled
./2005-11-24
./2005-11-24/thumbs
./2005-11-24/scaled
./2005-10-17
./2005-10-17/thumbs
./2005-10-17/scaled

I can workaround it by piping it to the sort command, but this shouldn't be needed.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 3 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-12-08 jay StatusNone Invalid
    Open/ClosedOpen Closed
2005-12-07 None Carbon-Copy- Added dhammis --AT-- hotmail --DOT-- com

Back to the top

Powered by Savane 3.13-3230.
Corresponding source code