]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/elftoolchain/strings/strings.1
Update Subversion to 1.14.0 LTS. See contrib/subversion/CHANGES for a
[FreeBSD/FreeBSD.git] / contrib / elftoolchain / strings / strings.1
1 .\" Copyright (c) 2007 S.Sam Arun Raj
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $Id: strings.1 3360 2016-01-24 18:34:06Z jkoshy $
26 .\"
27 .Dd January 24, 2016
28 .Dt STRINGS 1
29 .Os
30 .Sh NAME
31 .Nm strings
32 .Nd "print the strings of printable characters in files"
33 .Sh SYNOPSIS
34 .Nm
35 .Op Fl a | Fl -all
36 .Op Fl e Ar encoding | Fl -encoding= Ns Ar encoding
37 .Op Fl f | Fl -print-file-name
38 .Op Fl h | Fl -help
39 .Op Fl n Ar number | Fl -bytes= Ns Ar number | Fl Ar number
40 .Op Fl o
41 .Op Fl t Ar radix | Fl -radix= Ns Ar radix
42 .Op Fl v | Fl -version
43 .Op Ar
44 .Sh DESCRIPTION
45 For each
46 .Ar file
47 specified, the
48 .Nm
49 utility prints contiguous sequences of printable
50 characters that are at least
51 .Va n
52 characters long and are followed by an unprintable character.
53 The default value of
54 .Va n
55 is 4.
56 By default, the
57 .Nm
58 utility only scans the initialized and loaded sections of ELF objects;
59 for other file types, the entire file is scanned.
60 The
61 .Nm
62 utility is mainly used for determining the contents of non-text files.
63 .Pp
64 If no file name is specified as an argument, standard input is read.
65 .Pp
66 The following options are available:
67 .Bl -tag -width indent
68 .It Fl a | Fl -all
69 For ELF objects, scan the entire file for printable strings.
70 .It Fl e Ar encoding | Fl -encoding= Ns Ar encoding
71 Select the character encoding to be used while searching for strings.
72 Valid values for argument
73 .Ar encoding
74 are:
75 .Bl -tag -width indent -compact
76 .It Ar s
77 for single 7-bit-byte characters (ASCII, ISO 8859).
78 .It Ar S
79 for single 8-bit-byte characters.
80 .It Ar l
81 for 16-bit little-endian.
82 .It Ar b
83 for 16-bit big-endian.
84 .It Ar L
85 for 32-bit little-endian.
86 .It Ar B
87 for 32-bit big-endian.
88 .El
89 The default is to assume that characters are encoded using a single
90 7-bit byte.
91 .It Fl f | Fl -print-file-name
92 Print the name of the file before each string.
93 .It Fl h | Fl -help
94 Print a usage summary and exit.
95 .It Xo
96 .Fl n Ar number |
97 .Fl -bytes= Ns Ar number |
98 .Fl Ar number
99 .Xc
100 Print the contiguous character sequence of at least
101 .Ar number
102 characters long, instead of the default of 4 characters.
103 Argument
104 .Ar number
105 should specify a positive decimal integer.
106 .It Fl o
107 Equivalent to specifying
108 .Fl t Ar o .
109 .It Fl t Ar radix | Fl -radix= Ns Ar radix
110 Print the offset from the start of the file before each string
111 using the specified radix.
112 Valid values for argument
113 .Ar radix
114 are:
115 .Bl -tag -width indent -compact
116 .It Ar d
117 for decimal
118 .It Ar o
119 for octal
120 .It Ar x
121 for hexadecimal
122 .El
123 .It Fl v | Fl -version
124 Display a version identifier and exit.
125 .El
126 .Sh EXIT STATUS
127 .Ex -std
128 .Sh EXAMPLES
129 To display strings in
130 .Pa /bin/ls
131 use:
132 .Dl "$ strings /bin/ls"
133 .Pp
134 To display strings in all sections of
135 .Pa /bin/ln
136 use:
137 .Dl "$ strings -a /bin/ln"
138 .Pp
139 To display strings in all sections of
140 .Pa /bin/cat
141 prefixed with the filename and the offset within the file use:
142 .Dl "$ strings -a -f -t x /bin/cat"
143 .Sh SEE ALSO
144 .Xr ar 1 ,
145 .Xr nm 1 ,
146 .Xr objdump 1 ,
147 .Xr ranlib ,
148 .Xr readelf 1 ,
149 .Xr size 1
150 .Sh HISTORY
151 The first FreeBSD
152 .Nm
153 utility appeared in
154 .Fx v3.
155 It was later discontinued in
156 .Fx v5 ,
157 when i386-only a.out format was dropped in favor of ELF.
158 .Sh AUTHORS
159 .An -nosplit
160 The
161 .Nm
162 utility was re-written by
163 .An S.Sam Arun Raj Aq Mt samarunraj@gmail.com .
164 This manual page was written by
165 .An S.Sam Arun Raj Aq Mt samarunraj@gmail.com .