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-separator sep_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 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 (ASCII, ISO 8859, etc., default), S = single-8-bit-byte characters,
94 b = 16-bit bigendian, l = 16-bit littleendian, B = 32-bit
95 bigendian, L = 32-bit littleendian. Useful for finding wide
96 character strings. (l and b apply to, for example, Unicode
97 UTF-16/UCS-2 encodings).
98
99 -U [d|i|l|e|x|h]
100 --unicode=[default|invalid|locale|escape|hex|highlight]
101 Controls the display of UTF-8 encoded multibyte characters in
102 strings. The default (--unicode=default) is to give them no
103 special treatment, and instead rely upon the setting of the
104 --encoding option. The other values for this option automatically
105 enable --encoding=S.
106
107 The --unicode=invalid option treats them as non-graphic characters
108 and hence not part of a valid string. All the remaining options
109 treat them as valid string characters.
110
111 The --unicode=locale option displays them in the current locale,
112 which may or may not support UTF-8 encoding. The --unicode=hex
113 option displays them as hex byte sequences enclosed between <>
114 characters. The --unicode=escape option displays them as escape
115 sequences (\uxxxx) and the --unicode=highlight option displays them
116 as escape sequences highlighted in red (if supported by the output
117 device). The colouring is intended to draw attention to the
118 presence of unicode sequences where they might not be expected.
119
120 -T bfdname
121 --target=bfdname
122 Specify an object code format other than your system's default
123 format.
124
125 -v
126 -V
127 --version
128 Print the program version number on the standard output and exit.
129
130 -w
131 --include-all-whitespace
132 By default tab and space characters are included in the strings
133 that are displayed, but other whitespace characters, such a
134 newlines and carriage returns, are not. The -w option changes this
135 so that all whitespace characters are considered to be part of a
136 string.
137
138 -s
139 --output-separator
140 By default, output strings are delimited by a new-line. This option
141 allows you to supply any string to be used as the output record
142 separator. Useful with --include-all-whitespace where strings may
143 contain new-lines internally.
144
145 @file
146 Read command-line options from file. The options read are inserted
147 in place of the original @file option. If file does not exist, or
148 cannot be read, then the option will be treated literally, and not
149 removed.
150
151 Options in file are separated by whitespace. A whitespace
152 character may be included in an option by surrounding the entire
153 option in either single or double quotes. Any character (including
154 a backslash) may be included by prefixing the character to be
155 included with a backslash. The file may itself contain additional
156 @file options; any such options will be processed recursively.
157
159 ar(1), nm(1), objdump(1), ranlib(1), readelf(1) and the Info entries
160 for binutils.
161
163 Copyright (c) 1991-2022 Free Software Foundation, Inc.
164
165 Permission is granted to copy, distribute and/or modify this document
166 under the terms of the GNU Free Documentation License, Version 1.3 or
167 any later version published by the Free Software Foundation; with no
168 Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
169 Texts. A copy of the license is included in the section entitled "GNU
170 Free Documentation License".
171
172
173
174binutils-2.38 2022-12-30 STRINGS(1)