1STRINGS(1)                   GNU Development Tools                  STRINGS(1)
2
3
4

NAME

6       strings - print the sequences of printable characters in files
7

SYNOPSIS

9       strings [-afovV] [-min-len]
10               [-n min-len] [--bytes=min-len]
11               [-t radix] [--radix=radix]
12               [-e encoding] [--encoding=encoding]
13               [-U method] [--unicode=method]
14               [-] [--all] [--print-file-name]
15               [-T bfdname] [--target=bfdname]
16               [-w] [--include-all-whitespace]
17               [-s] [--output-separator sep_string]
18               [--help] [--version] file...
19

DESCRIPTION

21       For each file given, GNU strings prints the printable character
22       sequences that are at least 4 characters long (or the number given with
23       the options below) and are followed by an unprintable character.
24
25       Depending upon how the strings program was configured it will default
26       to either displaying all the printable sequences that it can find in
27       each file, or only those sequences that are in loadable, initialized
28       data sections.  If the file type is unrecognizable, or if strings is
29       reading from stdin then it will always display all of the printable
30       sequences that it can find.
31
32       For backwards compatibility any file that occurs after a command-line
33       option of just - will also be scanned in full, regardless of the
34       presence of any -d option.
35
36       strings is mainly useful for determining the contents of non-text
37       files.
38

OPTIONS

40       -a
41       --all
42       -   Scan the whole file, regardless of what sections it contains or
43           whether those sections are loaded or initialized.  Normally this is
44           the default behaviour, but strings can be configured so that the -d
45           is the default instead.
46
47           The - option is position dependent and forces strings to perform
48           full scans of any file that is mentioned after the - on the command
49           line, even if the -d option has been specified.
50
51       -d
52       --data
53           Only print strings from initialized, loaded data sections in the
54           file.  This may reduce the amount of garbage in the output, but it
55           also exposes the strings program to any security flaws that may be
56           present in the BFD library used to scan and load sections.  Strings
57           can be configured so that this option is the default behaviour.  In
58           such cases the -a option can be used to avoid using the BFD library
59           and instead just print all of the strings found in the file.
60
61       -f
62       --print-file-name
63           Print the name of the file before each string.
64
65       --help
66           Print a summary of the program usage on the standard output and
67           exit.
68
69       -min-len
70       -n min-len
71       --bytes=min-len
72           Print sequences of displayable characters that are at least min-len
73           characters long.  If not specified a default minimum length of 4 is
74           used.  The distinction between displayable and non-displayable
75           characters depends upon the setting of the -e and -U options.
76           Sequences are always terminated at control characters such as new-
77           line and carriage-return, but not the tab character.
78
79       -o  Like -t o.  Some other versions of strings have -o act like -t d
80           instead.  Since we can not be compatible with both ways, we simply
81           chose one.
82
83       -t radix
84       --radix=radix
85           Print the offset within the file before each string.  The single
86           character argument specifies the radix of the offset---o for octal,
87           x for hexadecimal, or d for decimal.
88
89       -e encoding
90       --encoding=encoding
91           Select the character encoding of the strings that are to be found.
92           Possible values for encoding are: s = single-7-bit-byte characters
93           (default), S = single-8-bit-byte characters, b = 16-bit bigendian,
94           l = 16-bit littleendian, B = 32-bit bigendian, L = 32-bit
95           littleendian.  Useful for finding wide character strings. (l and b
96           apply to, for example, Unicode UTF-16/UCS-2 encodings).
97
98       -U [d|i|l|e|x|h]
99       --unicode=[default|invalid|locale|escape|hex|highlight]
100           Controls the display of UTF-8 encoded multibyte characters in
101           strings.  The default (--unicode=default) is to give them no
102           special treatment, and instead rely upon the setting of the
103           --encoding option.  The other values for this option automatically
104           enable --encoding=S.
105
106           The --unicode=invalid option treats them as non-graphic characters
107           and hence not part of a valid string.  All the remaining options
108           treat them as valid string characters.
109
110           The --unicode=locale option displays them in the current locale,
111           which may or may not support UTF-8 encoding.  The --unicode=hex
112           option displays them as hex byte sequences enclosed between <>
113           characters.  The --unicode=escape option displays them as escape
114           sequences (\uxxxx) and the --unicode=highlight option displays them
115           as escape sequences highlighted in red (if supported by the output
116           device).  The colouring is intended to draw attention to the
117           presence of unicode sequences where they might not be expected.
118
119       -T bfdname
120       --target=bfdname
121           Specify an object code format other than your system's default
122           format.
123
124       -v
125       -V
126       --version
127           Print the program version number on the standard output and exit.
128
129       -w
130       --include-all-whitespace
131           By default tab and space characters are included in the strings
132           that are displayed, but other whitespace characters, such a
133           newlines and carriage returns, are not.  The -w option changes this
134           so that all whitespace characters are considered to be part of a
135           string.
136
137       -s
138       --output-separator
139           By default, output strings are delimited by a new-line. This option
140           allows you to supply any string to be used as the output record
141           separator.  Useful with --include-all-whitespace where strings may
142           contain new-lines internally.
143
144       @file
145           Read command-line options from file.  The options read are inserted
146           in place of the original @file option.  If file does not exist, or
147           cannot be read, then the option will be treated literally, and not
148           removed.
149
150           Options in file are separated by whitespace.  A whitespace
151           character may be included in an option by surrounding the entire
152           option in either single or double quotes.  Any character (including
153           a backslash) may be included by prefixing the character to be
154           included with a backslash.  The file may itself contain additional
155           @file options; any such options will be processed recursively.
156

SEE ALSO

158       ar(1), nm(1), objdump(1), ranlib(1), readelf(1) and the Info entries
159       for binutils.
160
162       Copyright (c) 1991-2023 Free Software Foundation, Inc.
163
164       Permission is granted to copy, distribute and/or modify this document
165       under the terms of the GNU Free Documentation License, Version 1.3 or
166       any later version published by the Free Software Foundation; with no
167       Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
168       Texts.  A copy of the license is included in the section entitled "GNU
169       Free Documentation License".
170
171
172
173binutils-2.40.00                  2023-07-30                        STRINGS(1)
Impressum