findutils-patches
[Top][All Lists]
Advanced

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

Re: Add sort option to find


From: Dale R. Worley
Subject: Re: Add sort option to find
Date: Thu, 03 Sep 2020 22:17:08 -0400

All of the discussion of efficiency is useful, but after writing my
assessment, I have the feeling that in practice, efficiency is not that
important.  In general, one is unlikely to have find generate a list of
over a million files, and with modern computers, usually such a list can
be sorted in RAM.

I think the significant advantage is one someone else mentioned:  find
-s sorts the output lines by the name of the file that generated them,
even when the file name is not the initial portion of the output line.

Another advantage is that find -s does not produce anomalous orders if
file names contain characters that sort before '/' in the collating
sequence.  In locale 'C', these characters are < '/':

    !"#$%&'()*+,-.

Of those, I commonly use 3 in file names.  So "find | sort" would
produce:

    a/b
    a/b#
    a/b-x
    a/b.c
    a/b/d
    a/by

whereas "find -s" would produce more natural grouping:

    a/b
    a/b/c
    a/b#
    a/b-x
    a/b.c
    a/by

Dale



reply via email to

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