1 .\" Copyright (c) 2007 S.Sam Arun Raj
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
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.
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
25 .\" $Id: strings.1 3360 2016-01-24 18:34:06Z jkoshy $
32 .Nd "print the strings of printable characters in files"
36 .Op Fl e Ar encoding | Fl -encoding= Ns Ar encoding
37 .Op Fl f | Fl -print-file-name
39 .Op Fl n Ar number | Fl -bytes= Ns Ar number | Fl Ar number
41 .Op Fl t Ar radix | Fl -radix= Ns Ar radix
42 .Op Fl v | Fl -version
49 utility prints contiguous sequences of printable
50 characters that are at least
52 characters long and are followed by an unprintable character.
58 utility only scans the initialized and loaded sections of ELF objects;
59 for other file types, the entire file is scanned.
62 utility is mainly used for determining the contents of non-text files.
64 If no file name is specified as an argument, standard input is read.
66 The following options are available:
67 .Bl -tag -width indent
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
75 .Bl -tag -width indent -compact
77 for single 7-bit-byte characters (ASCII, ISO 8859).
79 for single 8-bit-byte characters.
81 for 16-bit little-endian.
83 for 16-bit big-endian.
85 for 32-bit little-endian.
87 for 32-bit big-endian.
89 The default is to assume that characters are encoded using a single
91 .It Fl f | Fl -print-file-name
92 Print the name of the file before each string.
94 Print a usage summary and exit.
97 .Fl -bytes= Ns Ar number |
100 Print the contiguous character sequence of at least
102 characters long, instead of the default of 4 characters.
105 should specify a positive decimal integer.
107 Equivalent to specifying
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
115 .Bl -tag -width indent -compact
123 .It Fl v | Fl -version
124 Display a version identifier and exit.
129 To display strings in
132 .Dl "$ strings /bin/ls"
134 To display strings in all sections of
137 .Dl "$ strings -a /bin/ln"
139 To display strings in all sections of
141 prefixed with the filename and the offset within the file use:
142 .Dl "$ strings -a -f -t x /bin/cat"
155 It was later discontinued in
157 when i386-only a.out format was dropped in favor of ELF.
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 .