Debian Codegraph @

upstream/debian-unstable/man1/strings.1

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "STRINGS 1"
58 .TH STRINGS 1 2026-03-05 binutils-2.46 "GNU Development Tools"
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 strings \- print the sequences of printable characters in files
65 .SH SYNOPSIS
66 .IX Header "SYNOPSIS"
67 strings [\fB\-afovV\fR] [\fB\-\fR\fImin-len\fR]
68 [\fB\-n\fR \fImin-len\fR] [\fB\-\-bytes=\fR\fImin-len\fR]
69 [\fB\-t\fR \fIradix\fR] [\fB\-\-radix=\fR\fIradix\fR]
70 [\fB\-e\fR \fIencoding\fR] [\fB\-\-encoding=\fR\fIencoding\fR]
71 [\fB\-U\fR \fImethod\fR] [\fB\-\-unicode=\fR\fImethod\fR]
72 [\fB\-\fR] [\fB\-\-all\fR] [\fB\-\-print\-file\-name\fR]
73 [\fB\-T\fR \fIbfdname\fR] [\fB\-\-target=\fR\fIbfdname\fR]
74 [\fB\-w\fR] [\fB\-\-include\-all\-whitespace\fR]
75 [\fB\-s\fR] [\fB\-\-output\-separator\fR \fIsep_string\fR]
76 [\fB\-\-help\fR] [\fB\-\-version\fR] \fIfile\fR...
77 .SH DESCRIPTION
78 .IX Header "DESCRIPTION"
79 For each \fIfile\fR given, GNU \fBstrings\fR prints the
80 printable character sequences that are at least 4 characters long (or
81 the number given with the options below) and are followed by an
82 unprintable character.
83 .PP
84 Depending upon how the strings program was configured it will default
85 to either displaying all the printable sequences that it can find in
86 each file, or only those sequences that are in loadable, initialized
87 data sections. If the file type is unrecognizable, or if strings is
88 reading from stdin then it will always display all of the printable
89 sequences that it can find.
90 .PP
91 For backwards compatibility any file that occurs after a command-line
92 option of just \fB\-\fR will also be scanned in full, regardless of
93 the presence of any \fB\-d\fR option.
94 .PP
95 \&\fBstrings\fR is mainly useful for determining the contents of
96 non-text files.
97 .SH OPTIONS
98 .IX Header "OPTIONS"
99 .IP \fB\-a\fR 4
100 .IX Item "-a"
101 .PD 0
102 .IP \fB\-\-all\fR 4
103 .IX Item "--all"
104 .IP \fB\-\fR 4
105 .IX Item "-"
106 .PD
107 Scan the whole file, regardless of what sections it contains or
108 whether those sections are loaded or initialized. Normally this is
109 the default behaviour, but strings can be configured so that the
110 \&\fB\-d\fR is the default instead.
111 .Sp
112 The \fB\-\fR option is position dependent and forces strings to
113 perform full scans of any file that is mentioned after the \fB\-\fR
114 on the command line, even if the \fB\-d\fR option has been
115 specified.
116 .IP \fB\-d\fR 4
117 .IX Item "-d"
118 .PD 0
119 .IP \fB\-\-data\fR 4
120 .IX Item "--data"
121 .PD
122 Only print strings from initialized, loaded data sections in the
123 file. This may reduce the amount of garbage in the output, but it
124 also exposes the strings program to any security flaws that may be
125 present in the BFD library used to scan and load sections. Strings
126 can be configured so that this option is the default behaviour. In
127 such cases the \fB\-a\fR option can be used to avoid using the BFD
128 library and instead just print all of the strings found in the file.
129 .IP \fB\-f\fR 4
130 .IX Item "-f"
131 .PD 0
132 .IP \fB\-\-print\-file\-name\fR 4
133 .IX Item "--print-file-name"
134 .PD
135 Print the name of the file before each string.
136 .IP \fB\-\-help\fR 4
137 .IX Item "--help"
138 Print a summary of the program usage on the standard output and exit.
139 .IP \fB\-\fR\fImin-len\fR 4
140 .IX Item "-min-len"
141 .PD 0
142 .IP "\fB\-n\fR \fImin-len\fR" 4
143 .IX Item "-n min-len"
144 .IP \fB\-\-bytes=\fR\fImin-len\fR 4
145 .IX Item "--bytes=min-len"
146 .PD
147 Print sequences of displayable characters that are at least
148 \&\fImin-len\fR characters long. If not specified a default minimum
149 length of 4 is used. The distinction between displayable and
150 non-displayable characters depends upon the setting of the
151 \&\fB\-e\fR and \fB\-U\fR options. Sequences are always terminated
152 at control characters such as new-line and carriage-return, but not
153 the tab character.
154 .IP \fB\-o\fR 4
155 .IX Item "-o"
156 Like \fB\-t o\fR. Some other versions of \fBstrings\fR have \fB\-o\fR
157 act like \fB\-t d\fR instead. Since we can not be compatible with both
158 ways, we simply chose one.
159 .IP "\fB\-t\fR \fIradix\fR" 4
160 .IX Item "-t radix"
161 .PD 0
162 .IP \fB\-\-radix=\fR\fIradix\fR 4
163 .IX Item "--radix=radix"
164 .PD
165 Print the offset within the file before each string. The single
166 character argument specifies the radix of the offset\-\-\-\fBo\fR for
167 octal, \fBx\fR for hexadecimal, or \fBd\fR for decimal.
168 .IP "\fB\-e\fR \fIencoding\fR" 4
169 .IX Item "-e encoding"
170 .PD 0
171 .IP \fB\-\-encoding=\fR\fIencoding\fR 4
172 .IX Item "--encoding=encoding"
173 .PD
174 Select the character encoding of the strings that are to be found.
175 Possible values for \fIencoding\fR are: \fBs\fR = single\-7\-bit\-byte
176 characters (default), \fBS\fR =
177 single\-8\-bit\-byte characters, \fBb\fR = 16\-bit bigendian, \fBl\fR =
178 16\-bit littleendian, \fBB\fR = 32\-bit bigendian, \fBL\fR = 32\-bit
179 littleendian. Useful for finding wide character strings. (\fBl\fR
180 and \fBb\fR apply to, for example, Unicode UTF\-16/UCS\-2 encodings).
181 .IP "\fB\-U\fR \fI[d|i|l|e|x|h]\fR" 4
182 .IX Item "-U [d|i|l|e|x|h]"
183 .PD 0
184 .IP \fB\-\-unicode=\fR\fI[default|invalid|locale|escape|hex|highlight]\fR 4
185 .IX Item "--unicode=[default|invalid|locale|escape|hex|highlight]"
186 .PD
187 Controls the display of UTF\-8 encoded multibyte characters in strings.
188 The default (\fB\-\-unicode=default\fR) is to give them no special
189 treatment, and instead rely upon the setting of the
190 \&\fB\-\-encoding\fR option. The other values for this option
191 automatically enable \fB\-\-encoding=S\fR.
192 .Sp
193 The \fB\-\-unicode=invalid\fR option treats them as non-graphic
194 characters and hence not part of a valid string. All the remaining
195 options treat them as valid string characters.
196 .Sp
197 The \fB\-\-unicode=locale\fR option displays them in the current
198 locale, which may or may not support UTF\-8 encoding. The
199 \&\fB\-\-unicode=hex\fR option displays them as hex byte sequences
200 enclosed between \fI<>\fR characters. The \fB\-\-unicode=escape\fR
201 option displays them as escape sequences (\fI\euxxxx\fR) and the
202 \&\fB\-\-unicode=highlight\fR option displays them as escape sequences
203 highlighted in red (if supported by the output device). The colouring
204 is intended to draw attention to the presence of unicode sequences
205 where they might not be expected.
206 .IP "\fB\-T\fR \fIbfdname\fR" 4
207 .IX Item "-T bfdname"
208 .PD 0
209 .IP \fB\-\-target=\fR\fIbfdname\fR 4
210 .IX Item "--target=bfdname"
211 .PD
212 Specify an object code format other than your system's default format.
213 .IP \fB\-v\fR 4
214 .IX Item "-v"
215 .PD 0
216 .IP \fB\-V\fR 4
217 .IX Item "-V"
218 .IP \fB\-\-version\fR 4
219 .IX Item "--version"
220 .PD
221 Print the program version number on the standard output and exit.
222 .IP \fB\-w\fR 4
223 .IX Item "-w"
224 .PD 0
225 .IP \fB\-\-include\-all\-whitespace\fR 4
226 .IX Item "--include-all-whitespace"
227 .PD
228 By default tab and space characters are included in the strings that
229 are displayed, but other whitespace characters, such a newlines and
230 carriage returns, are not. The \fB\-w\fR option changes this so
231 that all whitespace characters are considered to be part of a string.
232 .IP \fB\-s\fR 4
233 .IX Item "-s"
234 .PD 0
235 .IP \fB\-\-output\-separator\fR 4
236 .IX Item "--output-separator"
237 .PD
238 By default, output strings are delimited by a new-line. This option
239 allows you to supply any string to be used as the output record
240 separator. Useful with \-\-include\-all\-whitespace where strings
241 may contain new-lines internally.
242 .IP \fB@\fR\fIfile\fR 4
243 .IX Item "@file"
244 Read command-line options from \fIfile\fR. The options read are
245 inserted in place of the original @\fIfile\fR option. If \fIfile\fR
246 does not exist, or cannot be read, then the option will be treated
247 literally, and not removed.
248 .Sp
249 Options in \fIfile\fR are separated by whitespace. A whitespace
250 character may be included in an option by surrounding the entire
251 option in either single or double quotes. Any character (including a
252 backslash) may be included by prefixing the character to be included
253 with a backslash. The \fIfile\fR may itself contain additional
254 @\fIfile\fR options; any such options will be processed recursively.
255 .SH "SEE ALSO"
256 .IX Header "SEE ALSO"
257 \&\fBar\fR\|(1), \fBnm\fR\|(1), \fBobjdump\fR\|(1), \fBranlib\fR\|(1), \fBreadelf\fR\|(1)
258 and the Info entries for \fIbinutils\fR.
259 .SH COPYRIGHT
260 .IX Header "COPYRIGHT"
261 Copyright (c) 1991\-2026 Free Software Foundation, Inc.
262 .PP
263 Permission is granted to copy, distribute and/or modify this document
264 under the terms of the GNU Free Documentation License, Version 1.3
265 or any later version published by the Free Software Foundation;
266 with no Invariant Sections, with no Front-Cover Texts, and with no
267 Back-Cover Texts. A copy of the license is included in the
268 section entitled "GNU Free Documentation License".