% $Id: strings.tex 1.2 1998/01/04 03:22:55 brian Exp $

\chapter{strings---Shows printable strings}

The \textbf{strings} command extracts and shows the printable strings in one or
more files including binary files. It is based on the *ix \textbf{strings}
command, except that it shows offsets in hexadecimal rather than octal.

\section{Usage}

\verb+strings [ -a ] [ -o ] [ -# ] [ -s ] [ fspec ... ]+
\medskip

The \textbf{strings} command searches one or more files for printable
ASCII strings and writes them to standard output. If no files are
specified, then the command searches standard input in binary mode.

The \textbf{isprint()} library function is used to test for printable
ASCII characters. A sequence of printable characters must be
terminated with a null, carriage return, or line feed character to be
considered a valid string.

\section{Flags}

The flags that are supported are similar to those supported by the
standard Unix \textbf{strings} command:

\begin{itemize}

    \item[\texttt{-a}]

        Search the entire file. This flag is present for command-line
        compatibility: this \textbf{strings} command always searches files in
        their entirety.

    \item[\texttt{-o}]

        Also show the offset of each string found. The offset is shown
        in hexadecimal and not octal, unlike the Unix \textbf{strings} command.

    \item[\texttt{-\#}]

         Specifiy a number for \texttt{\#}. Strings must have a
         minimum length of \texttt{\#} characters before they are
         shown. The default minimum number of characters is 4.

    \item[\texttt{-s}]

        Descend subdirectories, also.

    \item[\texttt{-S}]

        Search system and hidden files, also.

\end{itemize}
