Debian Codegraph @

upstream/mageia-cauldron/man1/strings.1

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