[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.7

1.7     ! aaron       1: .\"    $OpenBSD: strings.1,v 1.6 2000/03/11 21:40:03 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
1.5       provos     47: .Op Fl m Ar number
1.1       deraadt    48: .Op Fl t Ar radix
                     49: .Op Ar file ...
                     50: .Sh DESCRIPTION
1.4       aaron      51: .Nm
1.1       deraadt    52: displays the sequences of printable characters in each of the specified
                     53: files, or in the standard input, by default.
                     54: By default, a sequence must be at least four characters in length
                     55: before being displayed.
                     56: .Pp
                     57: The options are as follows:
                     58: .Bl -tag -width Ds
                     59: .It Fl a
                     60: By default,
1.4       aaron      61: .Nm
1.1       deraadt    62: only searches the text and data segments of object files.
                     63: The
                     64: .Fl a
                     65: option causes
1.4       aaron      66: .Nm
1.1       deraadt    67: to search the entire object file.
                     68: .It Fl f
                     69: Each string is preceded by the name of the file
                     70: in which it was found.
1.3       aaron      71: .It Fl n Ar number
1.1       deraadt    72: Specifies the minimum number of characters in a sequence to be
                     73: .Ar number ,
                     74: instead of four.
1.5       provos     75: .It Fl m Ar number
                     76: Specifies the maximum number of characters in a sequence to be
                     77: .Ar number ,
                     78: instead of unlimited.
1.1       deraadt    79: .It Fl o
                     80: Each string is preceded by its octal offset in the file.
1.3       aaron      81: .It Fl t Ar radix
1.6       aaron      82: Each string is preceded by its offset in the file.
                     83: The first character of
1.1       deraadt    84: .Ar radix
1.4       aaron      85: determines the radix of the offset:
1.1       deraadt    86: .Sq o
1.4       aaron      87: for octal;
1.1       deraadt    88: .Sq d
1.4       aaron      89: for decimal; or
1.1       deraadt    90: .Sq x
                     91: for hexadecimal.
                     92: .El
                     93: .Pp
1.4       aaron      94: .Nm
1.1       deraadt    95: is useful for identifying random binaries, among other things.
                     96: .Sh SEE ALSO
                     97: .Xr hexdump 1 ,
                     98: .Xr od 1
                     99: .Sh COMPATIBILITY
                    100: Historic implementations of
                    101: .Nm
                    102: only search the initialized data portion of the object file.
                    103: This was reasonable as strings were normally stored there.
1.4       aaron     104: Given new compiler technology which installs strings in the
1.1       deraadt   105: text portion of the object file, the default behavior was
                    106: changed.
                    107: .Sh STANDARDS
1.4       aaron     108: The
1.1       deraadt   109: .Nm
                    110: utility conforms to
                    111: .St -p1003.2-92 .
                    112: .Sh HISTORY
                    113: The
                    114: .Nm
                    115: utility appeared in
                    116: .Bx 3.0 .
1.7     ! aaron     117: .Sh BUGS
        !           118: The algorithm for identifying strings is extremely primitive.
        !           119: In particular, machine code instructions on certain architectures
        !           120: can resemble sequences of ASCII bytes, which
        !           121: will fool the algorithm.