find.1: explain why "find -s" may differ from "find | sort"

In short, that's because a directory name may end
with a character that goes before slash (/).

MFC after:	1 week
This commit is contained in:
Eugene Grosbein 2022-07-22 18:39:47 +07:00
parent 8f733dabcc
commit 26a329f49f

View File

@ -31,7 +31,7 @@
.\" @(#)find.1 8.7 (Berkeley) 5/9/95 .\" @(#)find.1 8.7 (Berkeley) 5/9/95
.\" $FreeBSD$ .\" $FreeBSD$
.\" .\"
.Dd November 8, 2021 .Dd July 22, 2022
.Dt FIND 1 .Dt FIND 1
.Os .Os
.Sh NAME .Sh NAME
@ -158,6 +158,26 @@ Note:
and and
.Ql "find | sort" .Ql "find | sort"
may give different results. may give different results.
.Pp
For example,
.Ql find -s
puts a directory
.Ql Ar foo
with all its contents before a directory
.Ql Ar foo.
but
.Ql "find | sort"
puts the directory name
.Ql Ar foo.
before any string like
.Ql Ar foo/bar
because
.Ql .\&
goes before
.Ql /
in ASCII. In locales other than
.Ar C
results may vary more due to collate differences.
.It Fl x .It Fl x
Prevent Prevent
.Nm .Nm