2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group. In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document. The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
25 .\" This notice shall appear on any product containing this material.
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
43 .\" Copyright 1989 AT&T
44 .\" Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
45 .\" Portions Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved
47 .TH STRINGS 1 "Apr 13, 2007"
49 strings \- find printable strings in an object or binary file
53 \fBstrings\fR [\fB-a\fR | \fB-\fR]
54 [\fB-t\fR \fIformat\fR | \fB-o\fR] [\fB-n\fR \fInumber\fR | \fB-number\fR] [\fB-N\fR \fIname\fR] [\fIfile\fR]...
60 The \fBstrings\fR utility looks for \fBASCII\fR strings in a binary file. A
61 string is any sequence of 4 or more printing characters ending with a NEWLINE
62 or a \fBNULL\fR character.
65 \fBstrings\fR is useful for identifying random object files and many other
69 By default, strings looks at program sections that are loaded in memory.
70 Program sections are identified by the section type \fBSHT_PROGBITS\fR.
71 Sections that are loaded in memory are identified by the section flag
72 \fBSHF_ALLOC\fR. Use \fBelfdump\fR(1) to display complete section information
76 All sections can be inspected with the \fB-a\fR option. Individual sections can
77 be inspected with the \fB-N\fR option.
81 The following options are supported:
85 \fB\fB-a\fR | \fB\(mi\fR\fR
88 Look everywhere in the file for strings.
94 \fB\fB-n\fR \fInumber\fR \fB|\fR \fB-\fR\fInumber\fR\fR
97 Use a \fInumber\fR as the minimum string length rather than the default, which
104 \fB\fB-N\fR \fIname\fR\fR
107 Look only in ELF section name. See \fBelfdump\fR(1). Multiple \fB-N\fR options
108 can be specified to inspect multiple sections.
110 If the \fB-a\fR or \fB-\fRoption is specified, all \fB-N\fR options are
120 Equivalent to \fB\fR\fB-t\fR \fBd\fR option.
126 \fB\fB-t\fR \fBformat\fR\fR
129 Write each string preceded by its byte offset from the start of the file. The
130 format is dependent on the single character used as the \fIformat\fR
138 The offset is written in decimal.
147 The offset is written in octal.
156 The offset is written in hexadecimal.
164 The following operand is supported:
168 \fB\fB\fIfile\fR\fR\fR
171 A path name of a regular file to be used as input. If no \fIfile\fR operand is
172 specified, the \fBstrings\fR utility reads from the standard input.
175 .SH ENVIRONMENT VARIABLES
178 See \fBenviron\fR(5) for descriptions of the following environment variables
179 that affect the execution of \fBstrings\fR: \fBLANG\fR, \fBLC_ALL\fR,
180 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
184 The following exit values are returned:
191 Successful completion.
206 See \fBattributes\fR(5) for descriptions of the following attributes:
214 ATTRIBUTE TYPE ATTRIBUTE VALUE
218 Interface Stability See below.
223 The \fBstrings\fR utility, including all options except \fB-N\fR, are specified
224 by standards. See \fBstandards\fR(5). The \fB-N\fR option is not currently
225 specified by any standard.
229 \fBelfdump\fR(1), \fBod\fR(1), \fBattributes\fR(5), \fBenviron\fR(5),
234 The algorithm for identifying strings is extremely primitive.
237 For backwards compatibility, the options \fB-a\fR and \fB\(mi\fR are