Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an old messy shell script. One of the steps executes find command with some parameters and expects the results to be sorted by creation time. It works well on old machines (find version is 4.1.7). On newer machines the results of find are not sorted by creation time.

Is there any simple way to tell find to sort the list of files found by file creation time, ascending?

P.S: I tried to read "man find" but it's confusing. :(

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

find does not provide a mechanism for sorting its output. You will need to postprocess (see -printf).

share|improve this answer
    
Than I must assume that sort by creation time of old version of find is "not a feature" :( –  Muxecoid Apr 28 '11 at 7:38
    
It never was. The filesystem calls were returning them that way. –  Ignacio Vazquez-Abrams Apr 28 '11 at 7:39
    
Thanks. The difference between the old and new system is that on old system the files were mounted over NFS and on new system the files are on local ext3 disk. This explains. –  Muxecoid Apr 28 '11 at 7:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.