[BACK]Return to strings.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / strings

Annotation of src/usr.bin/strings/strings.1, Revision 1.4

1.4     ! aaron       1: .\"    $OpenBSD: strings.1,v 1.3 1998/09/27 16:57:54 aaron Exp $
1.1       deraadt     2: .\"    $NetBSD: strings.1,v 1.4 1994/12/10 11:54:28 jtc Exp $
                      3: .\"
                      4: .\" Copyright (c) 1980, 1990, 1993
                      5: .\"    The Regents of the University of California.  All rights reserved.
                      6: .\"
                      7: .\" Redistribution and use in source and binary forms, with or without
                      8: .\" modification, are permitted provided that the following conditions
                      9: .\" are met:
                     10: .\" 1. Redistributions of source code must retain the above copyright
                     11: .\"    notice, this list of conditions and the following disclaimer.
                     12: .\" 2. Redistributions in binary form must reproduce the above copyright
                     13: .\"    notice, this list of conditions and the following disclaimer in the
                     14: .\"    documentation and/or other materials provided with the distribution.
                     15: .\" 3. All advertising materials mentioning features or use of this software
                     16: .\"    must display the following acknowledgement:
                     17: .\"    This product includes software developed by the University of
                     18: .\"    California, Berkeley and its contributors.
                     19: .\" 4. Neither the name of the University nor the names of its contributors
                     20: .\"    may be used to endorse or promote products derived from this software
                     21: .\"    without specific prior written permission.
                     22: .\"
                     23: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     24: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     25: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     26: .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     27: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     28: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     29: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     30: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     31: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     32: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     33: .\" SUCH DAMAGE.
                     34: .\"
                     35: .\"     @(#)strings.1  8.1 (Berkeley) 6/6/93
                     36: .\"
                     37: .Dd June 6, 1993
                     38: .Dt STRINGS 1
                     39: .Os
                     40: .Sh NAME
                     41: .Nm strings
                     42: .Nd find printable strings in a file
                     43: .Sh SYNOPSIS
                     44: .Nm strings
                     45: .Op Fl afo
                     46: .Op Fl n Ar number
                     47: .Op Fl t Ar radix
                     48: .Op Ar file ...
                     49: .Sh DESCRIPTION
1.4     ! aaron      50: .Nm
1.1       deraadt    51: displays the sequences of printable characters in each of the specified
                     52: files, or in the standard input, by default.
                     53: By default, a sequence must be at least four characters in length
                     54: before being displayed.
                     55: .Pp
                     56: The options are as follows:
                     57: .Bl -tag -width Ds
                     58: .It Fl a
                     59: By default,
1.4     ! aaron      60: .Nm
1.1       deraadt    61: only searches the text and data segments of object files.
                     62: The
                     63: .Fl a
                     64: option causes
1.4     ! aaron      65: .Nm
1.1       deraadt    66: to search the entire object file.
                     67: .It Fl f
                     68: Each string is preceded by the name of the file
                     69: in which it was found.
1.3       aaron      70: .It Fl n Ar number
1.1       deraadt    71: Specifies the minimum number of characters in a sequence to be
                     72: .Ar number ,
                     73: instead of four.
                     74: .It Fl o
                     75: Each string is preceded by its octal offset in the file.
1.3       aaron      76: .It Fl t Ar radix
1.1       deraadt    77: Each string is preceded by its offset in the file.  The first character of
                     78: .Ar radix
1.4     ! aaron      79: determines the radix of the offset:
1.1       deraadt    80: .Sq o
1.4     ! aaron      81: for octal;
1.1       deraadt    82: .Sq d
1.4     ! aaron      83: for decimal; or
1.1       deraadt    84: .Sq x
                     85: for hexadecimal.
                     86: .El
                     87: .Pp
1.4     ! aaron      88: .Nm
1.1       deraadt    89: is useful for identifying random binaries, among other things.
                     90: .Sh SEE ALSO
                     91: .Xr hexdump 1 ,
                     92: .Xr od 1
                     93: .Sh BUGS
                     94: The algorithm for identifying strings is extremely primitive.
                     95: In particular, machine code instructions on certain architectures
                     96: can resemble sequences of ASCII bytes, which
                     97: will fool the algorithm.
                     98: .Sh COMPATIBILITY
                     99: Historic implementations of
                    100: .Nm
                    101: only search the initialized data portion of the object file.
                    102: This was reasonable as strings were normally stored there.
1.4     ! aaron     103: Given new compiler technology which installs strings in the
1.1       deraadt   104: text portion of the object file, the default behavior was
                    105: changed.
                    106: .Sh STANDARDS
1.4     ! aaron     107: The
1.1       deraadt   108: .Nm
                    109: utility conforms to
                    110: .St -p1003.2-92 .
                    111: .Sh HISTORY
                    112: The
                    113: .Nm
                    114: utility appeared in
                    115: .Bx 3.0 .