strings.1   [plain text]


.\"	$OpenBSD: strings.1,v 1.2 1996/06/26 05:39:30 deraadt Exp $
.\"	$NetBSD: strings.1,v 1.4 1994/12/10 11:54:28 jtc Exp $
.\"
.\" Copyright (c) 1980, 1990, 1993
.\"	The Regents of the University of California.  All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"	This product includes software developed by the University of
.\"	California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"     @(#)strings.1	8.1 (Berkeley) 6/6/93
.\"
.TH STRINGS 1 "September 11, 2006" "Apple Computer, Inc."
.SH NAME
strings \- find the printable strings in a object, or other binary, file
.SH SYNOPSIS
.B strings
[
.B \-
] [
.B \-a
] [
.B \-o
] [
.B \-t
.I format
] [
\fB\-\fInumber\fR
] [
.B \-n
.I number
] [--] [file ...]
.SH DESCRIPTION
.I Strings
looks for ASCII strings in a binary file or standard input.
.I Strings
is useful for identifying random object files and many other things.
A string is any
sequence of 4 (the default) or more printing characters ending with a newline
or a null.  Unless the
.B \-
flag is given,
.I strings
looks in all sections of the object files except the (\_\^\_TEXT,\_\^\_text)
section.  If no files are specified standard input is read.
.PP
The file
arguments may be of the form
.IR "libx.a(foo.o)" ,
to request information about only that object file and not
the entire library.   (Typically this argument must be quoted,
.I ``libx.a(foo.o)'',
to get it past the shell.)
.PP
The options to
.IR strings (1)
are:
.TP
.B \-a
This option causes
.I strings
to look for strings in all sections of the object file (including the
(\_\^\_TEXT,\_\^\_text) section.
.TP
.B \-
This option causes
.I strings
to look for strings in all bytes of the files (the default for non-object files).
.TP
.B \-\-
This option causes
.I strings
to treat all the following arguments as files.
.TP
.B \-o
Preceded each string by its offset in the file (in decimal).
.TP
.BI \-t " format"
Write each string preceded by its byte offset from the start of the file.
The format shall be dependent on the single character used as the format
option-argument:
.TP
.I d
The offset shall be written in decimal.
.TP
.I o
The offset shall be written in octal.
.TP
.I x
The offset shall be written in hexadecimal.
.TP
.BI \- number
The decimal
.I number
is used as the minimum string length rather than the default of 4.
.TP
.BI \-n " number"
Specify the minimum string length, where the number argument is a positive
decimal integer. The default shall be 4.
.TP
.BI \-arch " arch_type"
Specifies the architecture,
.I arch_type,
of the file for
.IR strings (1)
to operate on when the file is a universal file.  (See
.IR arch (3)
for the currently know
.IR arch_type s.)
The
.I arch_type
can be "all" to operate on all architectures in the file.
.SH "SEE ALSO"
od(1)
.SH BUGS
The algorithm for identifying strings is extremely primitive.