1strings(1) User Commands strings(1)
2
3
4
6 strings - find printable strings in an object or binary file
7
9 strings [-a | -]
10 [-t format | -o] [-n number | -number] [-N name] [file]...
11
12
14 The strings utility looks for ASCII strings in a binary file. A string
15 is any sequence of 4 or more printing characters ending with a NEWLINE
16 or a NULL character.
17
18
19 strings is useful for identifying random object files and many other
20 things.
21
22
23 By default, strings looks at program sections that are loaded in mem‐
24 ory. Program sections are identified by the section type SHT_PROGBITS.
25 Sections that are loaded in memory are identified by the section flag
26 SHF_ALLOC. Use elfdump(1) to display complete section information for
27 a file.
28
29
30 All sections can be inspected with the -a option. Individual sections
31 can be inspected with the -N option.
32
34 The following options are supported:
35
36 -a | − Look everywhere in the file for strings.
37
38
39 -n number | -number Use a number as the minimum string length rather
40 than the default, which is 4.
41
42
43 -N name Look only in ELF section name. See elfdump(1).
44 Multiple -N options can be specified to inspect
45 multiple sections.
46
47 If the -a or -option is specified, all -N
48 options are ignored .
49
50
51 -o Equivalent to -t d option.
52
53
54 -t format Write each string preceded by its byte offset
55 from the start of the file. The format is depen‐
56 dent on the single character used as the format
57 option-argument:
58
59 d The offset is written in decimal.
60
61
62 o The offset is written in octal.
63
64
65 x The offset is written in hexadecimal.
66
67
68
70 The following operand is supported:
71
72 file A path name of a regular file to be used as input. If no file
73 operand is specified, the strings utility reads from the stan‐
74 dard input.
75
76
78 See environ(5) for descriptions of the following environment variables
79 that affect the execution of strings: LANG, LC_ALL, LC_CTYPE, LC_MES‐
80 SAGES, and NLSPATH.
81
83 The following exit values are returned:
84
85 0 Successful completion.
86
87
88 >0 An error occurred.
89
90
92 See attributes(5) for descriptions of the following attributes:
93
94
95
96
97 ┌─────────────────────────────┬─────────────────────────────┐
98 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
99 ├─────────────────────────────┼─────────────────────────────┤
100 │Availability │SUNWtoo │
101 ├─────────────────────────────┼─────────────────────────────┤
102 │CSI │Enabled │
103 ├─────────────────────────────┼─────────────────────────────┤
104 │Interface Stability │See below. │
105 └─────────────────────────────┴─────────────────────────────┘
106
107
108 The strings utility, including all options except -N, are specified by
109 standards. See standards(5). The -N option is not currently specified
110 by any standard.
111
113 elfdump(1), od(1), attributes(5), environ(5), standards(5)
114
116 The algorithm for identifying strings is extremely primitive.
117
118
119 For backwards compatibility, the options -a and − are interchangeable.
120
121
122
123SunOS 5.11 13 Apr 2007 strings(1)