From nobody Sat Jul 26 17:12:44 2025 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 4bqBBh4HTsz62DKr; Sat, 26 Jul 2025 17:12:44 +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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bqBBh2kt2z3Pfs; Sat, 26 Jul 2025 17:12:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753549964; 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=FFslMMUXrTDs8Yvo8XyS7fuFkUybrzo4CjFlQYAFwUs=; b=ynJF9xQPuTWE4GVXBhGqvUV7iMpKzf7FvqgaLze+fIoERDLt+d2Y/SwqIW9uv7GnvsoeKs pkNX4LYPDFHr5gCQWQyVaYahn5yqe8exn9tIpog+6LBrVNDca9NOEBSHTmjCTZlHI9FDkB xt+SJBWeSdwvFhcIvZ5WwMyj2SoWWbeS9xJ6SPYebJr2yefg/paVS9Uq4NS0YW+lfsvs+1 JzCv+Lh+Fz2PWRMbRK8FI0Ltx5KiFzbbLj1Sv8dN3oWaGpNz42UaQZVbIQMXDKi2zsw00x NQnR6nlHhUvEORRPETXnNqRcUT8mpmLG0SYjeTz5iS7DInFtM0sxXCmH+L/koA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753549964; 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=FFslMMUXrTDs8Yvo8XyS7fuFkUybrzo4CjFlQYAFwUs=; b=B1VPu4a4WGXV+pWSQEXRNJ8kPfmfZwYHD30+crBowiuR1RYrxiL8O/i93W0WOk4OjdUDup RNA1WxZQ1YoO6+z00yH7MmqYdEgVtxDnKT6pHqSH0r2WBFLYPWnTYHAi73EibxUne7qJnF 3AGRiKmx6r0zn8oG0vX1wNMROy6C/ScyRztqNosiuVqnTZbvJcCIbONJlhuBeWs4Jsz1oR Ld8823JPe/3HFeSLKlfKySa3uCYD2Lyn/dffxGpj98Qg8xrGzJSS0hBf0oB+aw9ZtND7gI DzoBIIb2Q6iLGxW7cQMsg5JrgjolVT9AeHFPZBQxHnP2oCqK5rz5GLja/3+HYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753549964; a=rsa-sha256; cv=none; b=lYuXVNKDaphwQ3ZU3id2Db1U+MEx0r2R90sicehvcTO2uDaIXV03ZT5vKK8fqVTX0XG5xZ A5+JqDEnXfTc0hyErQVtHEbV2J287xJMwLYZxldz7+FkKacieM1GOjyDos8JWMMz+F6vCR MVeRno/hmGKheDgvx6CQnI3soMHLnKJhynTcxX46jhpqcAOE8VMB5UnGs2uvdqpwWQteXn kPk8dpeK+MWXXlFJ4tyo1DvxyNv+F8gWb4R0kZ8tyAMdAzs8YR7R2XIslH8QuYQasksgSl kIdWjw35ITQfYmu6Sn7ygJJbdrof3zcti8uYquhtBCTexjjq5gzIONLxBPKYxQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bqBBh2GgFzfn8; Sat, 26 Jul 2025 17:12:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56QHCiwq082741; Sat, 26 Jul 2025 17:12:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56QHCi97082738; Sat, 26 Jul 2025 17:12:44 GMT (envelope-from git) Date: Sat, 26 Jul 2025 17:12:44 GMT Message-Id: <202507261712.56QHCi97082738@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: a52d0d76fa3e - main - find: Document possible formats List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a52d0d76fa3e47d5d64b4620280f26979afe15fc Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a52d0d76fa3e47d5d64b4620280f26979afe15fc commit a52d0d76fa3e47d5d64b4620280f26979afe15fc Author: Warner Losh AuthorDate: 2025-07-26 17:11:10 +0000 Commit: Warner Losh CommitDate: 2025-07-26 17:12:38 +0000 find: Document possible formats Accidentlaly committed with XXX write this. So write which formats -printf supports. Sponsored by: Netflix --- usr.bin/find/find.1 | 76 +++++++++++++++++++++++++++++++++++++++++++++++++-- usr.bin/find/printf.c | 6 ++++ 2 files changed, 80 insertions(+), 2 deletions(-) diff --git a/usr.bin/find/find.1 b/usr.bin/find/find.1 index 3012ae472015..e5ca81e69bdc 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 November 23, 2024 +.Dd July 26, 2025 .Dt FIND 1 .Os .Sh NAME @@ -1096,7 +1096,79 @@ as zero; It is not yet implemented. .It Format: One or two characters, described below, which indicates the information to display. -XXX need to write this. +.Bl -tag -width Ds +.It p +Path to file +.It f +Filename without directories. +.It h +Path relative to the starting point, or '.' if that's empty for some reason. +.It P +Unimplemented -- File with command line arg. +.It H +Unimplemented -- Command line arg. +.It g +gid in human readable form. +.It G +gid as a number. +.It h +uid in human readable form. +.It U +uid as a number. +.It m +File permission mode in octal. +.It M +File mode in +.Xr ls 1 +standard form. +.It k +File size in KiB (units of 1024 bytes). +.It b +File size in blocks (Always 512 byte units, even if underlying storage +size differs). +.It s +Size in bytes of the file. +.It S +Sparseness of the file. +The blocks the file occupies times 512 divided by the file size. +.It d +Depth in the tree +.It D +Device number for the file. +.It F +Unimplemented -- Filesystem type where the file resides. +.It l +Object of the symbolic link. +.It i +Inode of the file. +.It n +Number of hard links. +.It y +Unimplemented -- Type of the file +.It Y +Unimplemented -- Type of the file with loop detection +.It a +Access time of the file. +.It A +Access time of the file in strftime format. +Takes an additional argument. +.It b +Birth time of a file. +.It B +Birth time of the file in strftime format. +Takes an additional argument. +.It c +Creation time of the file. +.It C +Creation time of the file in strftime format. +Takes an additional argument. +.It t +Modification time of the file. +.It T +Modification time of the file in strftime format. +Takes an additional argument. +.El +Any format not listed is not supported, though the error changes. .El .El .Sh ENVIRONMENT diff --git a/usr.bin/find/printf.c b/usr.bin/find/printf.c index 671d1d1dbb9a..532c17bfb80b 100644 --- a/usr.bin/find/printf.c +++ b/usr.bin/find/printf.c @@ -269,6 +269,12 @@ do_printf(PLAN *plan, FTSENT *entry, FILE *fout) case 'A': /* access time with next char strftime format */ fp_strftime(fp, sb->st_atime, *fmt++); break; + case 'b': /* birth time */ +#ifdef HAVE_STRUCT_STAT_ST_BIRTHTIME + fp_ctime(fp, sb->st_birthtime); +#else + fp_ctime(fp, 0); +#endif case 'B': /* birth time with next char strftime format */ #ifdef HAVE_STRUCT_STAT_ST_BIRTHTIME if (sb->st_birthtime != 0)