git: a03b051f238e - main - locate.1: clarify bytes vs. characters
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 24 Oct 2026 10:16:07 UTC
The branch main has been updated by wosch:
URL: https://cgit.FreeBSD.org/src/commit/?id=a03b051f238eb78cfccbe834b0cc206e66d566e5
commit a03b051f238eb78cfccbe834b0cc206e66d566e5
Author: Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2026-10-24 10:12:05 +0000
Commit: Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2026-10-24 10:12:05 +0000
locate.1: clarify bytes vs. characters
The database stores bytes, not characters. Remove the historical
note about 7-bit storage. Also document that -i ignores case only
for ASCII letters.
Reviewed by: ziaee
MFC after: 3 days
---
usr.bin/locate/locate/locate.1 | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/usr.bin/locate/locate/locate.1 b/usr.bin/locate/locate/locate.1
index 4999722acfc5..8deb68ee5e08 100644
--- a/usr.bin/locate/locate/locate.1
+++ b/usr.bin/locate/locate/locate.1
@@ -1,4 +1,4 @@
-.\" Copyright (c) 1995 Wolfram Schneider <wosch@FreeBSD.org>. Berlin.
+.\" Copyright (c) 1995-2026 Wolfram Schneider <wosch@FreeBSD.org>
.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
@@ -26,7 +26,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd December 11, 2020
+.Dd October 22, 2026
.Dt LOCATE 1
.Os
.Sh NAME
@@ -70,17 +70,16 @@ As a special case, a pattern containing no globbing characters
is matched as though it were
.Dq *foo* .
.Pp
-Historically, locate only stored characters between 32 and 127.
-The
-current implementation stores any character except newline
+The database can store any byte in a path name except newline
.Pq Sq \en
and
.Dv NUL
.Pq Sq \e0 .
-The 8-bit character support does not waste extra space for
-plain ASCII file names.
-Characters less than 32 or greater than 127
-are stored in 2 bytes.
+Bytes with values from 32 to 127
+.Pq printable ASCII characters and DEL
+are stored in at most one byte;
+all other bytes take two bytes.
+For example, a two-byte UTF-8 character takes four bytes in the database.
.Pp
The following options are available:
.Bl -tag -width 10n
@@ -159,6 +158,7 @@ Note: you can only use
pattern for stdin.
.It Fl i
Ignore case distinctions in both the pattern and the database.
+Only ASCII letters are folded.
.It Fl l Ar number
Limit output to
.Ar number
@@ -266,3 +266,6 @@ a locate database which was built on SunOS/sparc machine
The
.Nm
utility does not recognize multibyte characters.
+The
+.Fl i
+option ignores case only for ASCII letters.