1STRINGS(1) GNU Development Tools STRINGS(1)
2
3
4
6 strings - print the sequences of printable characters in files
7
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-separatorsep_string]
18 [--help] [--version] file...
19
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
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 characters that are at least min-len characters
73 long, instead of the default 4.
74
75 -o Like -t o. Some other versions of strings have -o act like -t d
76 instead. Since we can not be compatible with both ways, we simply
77 chose one.
78
79 -t radix
80 --radix=radix
81 Print the offset within the file before each string. The single
82 character argument specifies the radix of the offset---o for octal,
83 x for hexadecimal, or d for decimal.
84
85 -e encoding
86 --encoding=encoding
87 Select the character encoding of the strings that are to be found.
88 Possible values for encoding are: s = single-7-bit-byte characters
89 (ASCII, ISO 8859, etc., default), S = single-8-bit-byte characters,
90 b = 16-bit bigendian, l = 16-bit littleendian, B = 32-bit
91 bigendian, L = 32-bit littleendian. Useful for finding wide
92 character strings. (l and b apply to, for example, Unicode
93 UTF-16/UCS-2 encodings).
94
95 -U [d|i|l|e|x|h]
96 --unicode=[default|invalid|locale|escape|hex|highlight]
97 Controls the display of UTF-8 encoded mulibyte characters in
98 strings. The default (--unicode=default) is to give them no
99 special treatment, and instead rely upon the setting of the
100 --encoding option. The other values for this option automatically
101 enable --encoding=S.
102
103 The --unicode=invalid option treats them as non-graphic characters
104 and hence not part of a valid string. All the remaining options
105 treat them as valid string characters.
106
107 The --unicode=locale option displays them in the current locale,
108 which may or may not support UTF-8 encoding. The --unicode=hex
109 option displays them as hex byte sequences enclosed between <>
110 characters. The --unicode=escape option displays them as escape
111 sequences (\uxxxx) and the --unicode=highlight option displays them
112 as escape sequences highlighted in red (if supported by the output
113 device). The colouring is intended to draw attention to the
114 presence of unicode sequences where they might not be expected.
115
116 -T bfdname
117 --target=bfdname
118 Specify an object code format other than your system's default
119 format.
120
121 -v
122 -V
123 --version
124 Print the program version number on the standard output and exit.
125
126 -w
127 --include-all-whitespace
128 By default tab and space characters are included in the strings
129 that are displayed, but other whitespace characters, such a
130 newlines and carriage returns, are not. The -w option changes this
131 so that all whitespace characters are considered to be part of a
132 string.
133
134 -s
135 --output-separator
136 By default, output strings are delimited by a new-line. This option
137 allows you to supply any string to be used as the output record
138 separator. Useful with --include-all-whitespace where strings may
139 contain new-lines internally.
140
141 @file
142 Read command-line options from file. The options read are inserted
143 in place of the original @file option. If file does not exist, or
144 cannot be read, then the option will be treated literally, and not
145 removed.
146
147 Options in file are separated by whitespace. A whitespace
148 character may be included in an option by surrounding the entire
149 option in either single or double quotes. Any character (including
150 a backslash) may be included by prefixing the character to be
151 included with a backslash. The file may itself contain additional
152 @file options; any such options will be processed recursively.
153
155 ar(1), nm(1), objdump(1), ranlib(1), readelf(1) and the Info entries
156 for binutils.
157
159 Copyright (c) 1991-2021 Free Software Foundation, Inc.
160
161 Permission is granted to copy, distribute and/or modify this document
162 under the terms of the GNU Free Documentation License, Version 1.3 or
163 any later version published by the Free Software Foundation; with no
164 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
165 Texts. A copy of the license is included in the section entitled "GNU
166 Free Documentation License".
167
168
169
170binutils-2.37 2022-03-10 STRINGS(1)