From nobody Thu Oct 22 08:56:24 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4j9Kkw6khsz6wZHR for ; Thu, 22 Oct 2026 08:56:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4j9Kkw5r37z3LW2 for ; Thu, 22 Oct 2026 08:56:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792659384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SPKzhuT0ofn7M3WGVq87ej0Eb/W9nZYR7nN5bBiWqLA=; b=nv9MxSxV83DzyPNHnb872izqdTmqrYMUPIQrZRJGHBfH1BiiH9NJL2lAeR14sziAYvmP6Y ae7prJQabsdTnooNxw0POSR7iN2Afb4YT8tc+ERM+68UKdENU50pcWlnEPqgHQJHnqDVFm pzn/l00F+0J++oK+gM0luKo+7O2l7zITvFhwQ9iPf7RB+JVTW4G7wqde4EBoorPOhbOFp8 7sMvteFeBa+ASs6w3dk7GtpSPPwIoiLMEAvzmPInosf5hIJOSlM+F5Q12FIM4LgVtSJbPf vOQ7ZYG/6jUci0fL1/7k/C6MKRfo98Pt0OhaaytNrpn1OuFiM6u4qHtvB6NBjw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1792659384; b=FDbP+WjnIalEXo+48HkcZj8tAgt63Y9FJkHzo8/cYwlu6bSYt+eEc8YE1Y8jhpQz7+7wGs EFnc3KAn0l5JhT3imV5V8V0m/3h8hdunVq6YsBnis4xYx+MtTu7rbdvUsL5tewSzjDYovY 7Vz9dfLloL7cpIv/rDbmv4sA8FeIeJlcLsFwqi62CRsVnQGBPdMNSbdaXpcKs28mdFA151 JrS8KJMWQjepkvXiKrd1dIFdzsDWmnf1pogctdOdxNR/0AYcOz14RLdaOD9iFa9KEI/Y6U qawqGoxTj74x1UzOTyybRPaXC7xqrozdJSlZXayrwRQ0oxLtOuJUZw+OG5C6rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1792659384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SPKzhuT0ofn7M3WGVq87ej0Eb/W9nZYR7nN5bBiWqLA=; b=yMG7AxtoFFRe0IiASXx905StNKtJrS+bG9P2POM8y+WMVRn+gBFonB96p6u2rRTO9ZCuyS QYfGegf7XIJj2WHYs+bbHVbDsz0EziK7KQc3h8rhArJIfv3EGXTkZqL8stVJ4Qc5tjN7kK p1ezf9hza249hbyGpt4RlFpHLwxiExq3OpyzoKhbQgJ/mHJNRnF94qXVyaAiiPByJqxh7Z ykzUz8L1uVZ+Vmez0GNUwlgUUgGTeB4bPFwpt7MjktkM1bOdEHWj9RxnIVG31+VG/Ggl2h RSUOgtyrcSWZRprkuc4lxzSkf74bsxdAYxGLPqfojpA7RUFRMJdO+NO04hjOOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4j9Kkw5TcZzbP2 for ; Thu, 22 Oct 2026 08:56:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 27301 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 22 Oct 2026 08:56:24 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wolfram Schneider Subject: git: ad0f86694157 - main - find.1: rewrite the -s flag section for clarity List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: Commit messages for the main branch of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ad0f86694157c998fec500e9a553550976cbc100 Auto-Submitted: auto-generated Date: Thu, 22 Oct 2026 08:56:24 +0000 Message-Id: <6ad9cfb8.27301.4aa64aab@gitrepo.freebsd.org> The branch main has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=ad0f86694157c998fec500e9a553550976cbc100 commit ad0f86694157c998fec500e9a553550976cbc100 Author: Wolfram Schneider AuthorDate: 2026-10-22 08:50:56 +0000 Commit: Wolfram Schneider CommitDate: 2026-10-22 08:50:56 +0000 find.1: rewrite the -s flag section for clarity Restructure the description of -s flag: 1. what the option does 2. why it is useful (deterministic order, streaming output) 3. how its results can differ from `find | sort' Reviewed by: ziaee MFC after: 3 days --- usr.bin/find/find.1 | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1 index d3929bcb1807..05054fe84e6a 100644 --- a/usr.bin/find/find.1 +++ b/usr.bin/find/find.1 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 14, 2026 +.Dd October 20, 2026 .Dt FIND 1 .Os .Sh NAME @@ -149,23 +149,44 @@ and Cause .Nm to traverse the file hierarchies in lexicographical order, -i.e., alphabetical order within each directory. -Note: -.Ql find -s +sorting entries within each directory. +.Pp +The output order is deterministic for a given locale and does not +depend on the type of +file system or on the order in which directory entries were created. +This is useful for comparing results between runs, reproducible +builds, and automated tests. +.Pp +Since entries are sorted per directory, +.Ql "find -s" +typically uses less memory and temporary disk space than +.Ql "find | sort" . +Unlike +.Ql "find | sort" , +.Ql "find -s" +can produce output while the traversal is still in progress, +allowing a long-running pipeline such as +.Ql "find -s . -print0 | xargs -0 -n1 /slow/script" +to begin processing files immediately. +The predictable order also makes the progress easy to follow, +e.g., with +.Xr ps 1 . +.Pp +Note that +.Ql "find -s" and .Ql "find | sort" may give different results. -.Pp For example, -.Ql find -s +.Ql "find -s" puts a directory .Ql Ar foo with all its contents before a directory -.Ql Ar foo.\& +.Ql Ar foo\&. , but .Ql "find | sort" puts the directory name -.Ql Ar foo.\& +.Ql Ar foo\&. before any string like .Ql Ar foo/bar because @@ -174,8 +195,8 @@ goes before .Ql / in ASCII. In locales other than -.Ar C -results may vary more due to collation differences. +.Ar C , +the two may differ further because of locale-dependent collation. .It Fl x Prevent .Nm