265 lines
8.0 KiB
HTML
265 lines
8.0 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of STRINGS</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>STRINGS</H1>
|
|
Section: GNU Development Tools (1)<BR>Updated: 2021-01-21<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
strings - print the sequences of printable characters in files
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
strings [<B>-afovV</B>] [<B>-</B><I>min-len</I>]
|
|
<BR> [<B>-n</B> <I>min-len</I>] [<B>--bytes=</B><I>min-len</I>]
|
|
<BR> [<B>-t</B> <I>radix</I>] [<B>--radix=</B><I>radix</I>]
|
|
<BR> [<B>-e</B> <I>encoding</I>] [<B>--encoding=</B><I>encoding</I>]
|
|
<BR> [<B>-</B>] [<B>--all</B>] [<B>--print-file-name</B>]
|
|
<BR> [<B>-T</B> <I>bfdname</I>] [<B>--target=</B><I>bfdname</I>]
|
|
<BR> [<B>-w</B>] [<B>--include-all-whitespace</B>]
|
|
<BR> [<B>-s</B>] [<B>--output-separator</B><I>sep_string</I>]
|
|
<BR> [<B>--help</B>] [<B>--version</B>] <I>file</I>...
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
For each <I>file</I> given, <FONT SIZE="-1">GNU</FONT> <B>strings</B> prints the
|
|
printable character sequences that are at least 4 characters long (or
|
|
the number given with the options below) and are followed by an
|
|
unprintable character.
|
|
<P>
|
|
|
|
Depending upon how the strings program was configured it will default
|
|
to either displaying all the printable sequences that it can find in
|
|
each file, or only those sequences that are in loadable, initialized
|
|
data sections. If the file type in unrecognizable, or if strings is
|
|
reading from stdin then it will always display all of the printable
|
|
sequences that it can find.
|
|
<P>
|
|
|
|
For backwards compatibility any file that occurs after a command-line
|
|
option of just <B>-</B> will also be scanned in full, regardless of
|
|
the presence of any <B>-d</B> option.
|
|
<P>
|
|
|
|
<B>strings</B> is mainly useful for determining the contents of
|
|
non-text files.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="1"><B>-a</B><DD>
|
|
|
|
|
|
|
|
<DT id="2"><B>--all</B><DD>
|
|
|
|
|
|
<DT id="3"><B>-</B><DD>
|
|
|
|
|
|
|
|
Scan the whole file, regardless of what sections it contains or
|
|
whether those sections are loaded or initialized. Normally this is
|
|
the default behaviour, but strings can be configured so that the
|
|
<B>-d</B> is the default instead.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
The <B>-</B> option is position dependent and forces strings to
|
|
perform full scans of any file that is mentioned after the <B>-</B>
|
|
on the command line, even if the <B>-d</B> option has been
|
|
specified.
|
|
<DT id="4"><B>-d</B><DD>
|
|
|
|
|
|
|
|
<DT id="5"><B>--data</B><DD>
|
|
|
|
|
|
|
|
Only print strings from initialized, loaded data sections in the
|
|
file. This may reduce the amount of garbage in the output, but it
|
|
also exposes the strings program to any security flaws that may be
|
|
present in the <FONT SIZE="-1">BFD</FONT> library used to scan and load sections. Strings
|
|
can be configured so that this option is the default behaviour. In
|
|
such cases the <B>-a</B> option can be used to avoid using the <FONT SIZE="-1">BFD</FONT>
|
|
library and instead just print all of the strings found in the file.
|
|
<DT id="6"><B>-f</B><DD>
|
|
|
|
|
|
|
|
<DT id="7"><B>--print-file-name</B><DD>
|
|
|
|
|
|
|
|
Print the name of the file before each string.
|
|
<DT id="8"><B>--help</B><DD>
|
|
|
|
|
|
Print a summary of the program usage on the standard output and exit.
|
|
<DT id="9"><B>-</B><I>min-len</I><DD>
|
|
|
|
|
|
|
|
<DT id="10"><B>-n</B> <I>min-len</I><DD>
|
|
|
|
|
|
<DT id="11"><B>--bytes=</B><I>min-len</I><DD>
|
|
|
|
|
|
|
|
Print sequences of characters that are at least <I>min-len</I> characters
|
|
long, instead of the default 4.
|
|
<DT id="12"><B>-o</B><DD>
|
|
|
|
|
|
Like <B>-t o</B>. Some other versions of <B>strings</B> have <B>-o</B>
|
|
act like <B>-t d</B> instead. Since we can not be compatible with both
|
|
ways, we simply chose one.
|
|
<DT id="13"><B>-t</B> <I>radix</I><DD>
|
|
|
|
|
|
|
|
<DT id="14"><B>--radix=</B><I>radix</I><DD>
|
|
|
|
|
|
|
|
Print the offset within the file before each string. The single
|
|
character argument specifies the radix of the offset---<B>o</B> for
|
|
octal, <B>x</B> for hexadecimal, or <B>d</B> for decimal.
|
|
<DT id="15"><B>-e</B> <I>encoding</I><DD>
|
|
|
|
|
|
|
|
<DT id="16"><B>--encoding=</B><I>encoding</I><DD>
|
|
|
|
|
|
|
|
Select the character encoding of the strings that are to be found.
|
|
Possible values for <I>encoding</I> are: <B>s</B> = single-7-bit-byte
|
|
characters (<FONT SIZE="-1">ASCII, ISO 8859,</FONT> etc., default), <B>S</B> =
|
|
single-8-bit-byte characters, <B>b</B> = 16-bit bigendian, <B>l</B> =
|
|
16-bit littleendian, <B>B</B> = 32-bit bigendian, <B>L</B> = 32-bit
|
|
littleendian. Useful for finding wide character strings. (<B>l</B>
|
|
and <B>b</B> apply to, for example, Unicode <FONT SIZE="-1">UTF-16/UCS-2</FONT> encodings).
|
|
<DT id="17"><B>-T</B> <I>bfdname</I><DD>
|
|
|
|
|
|
|
|
<DT id="18"><B>--target=</B><I>bfdname</I><DD>
|
|
|
|
|
|
|
|
Specify an object code format other than your system's default format.
|
|
<DT id="19"><B>-v</B><DD>
|
|
|
|
|
|
|
|
<DT id="20"><B>-V</B><DD>
|
|
|
|
|
|
<DT id="21"><B>--version</B><DD>
|
|
|
|
|
|
|
|
Print the program version number on the standard output and exit.
|
|
<DT id="22"><B>-w</B><DD>
|
|
|
|
|
|
|
|
<DT id="23"><B>--include-all-whitespace</B><DD>
|
|
|
|
|
|
|
|
By default tab and space characters are included in the strings that
|
|
are displayed, but other whitespace characters, such a newlines and
|
|
carriage returns, are not. The <B>-w</B> option changes this so
|
|
that all whitespace characters are considered to be part of a string.
|
|
<DT id="24"><B>-s</B><DD>
|
|
|
|
|
|
|
|
<DT id="25"><B>--output-separator</B><DD>
|
|
|
|
|
|
|
|
By default, output strings are delimited by a new-line. This option
|
|
allows you to supply any string to be used as the output record
|
|
separator. Useful with --include-all-whitespace where strings
|
|
may contain new-lines internally.
|
|
<DT id="26"><B>@</B><I>file</I><DD>
|
|
|
|
|
|
Read command-line options from <I>file</I>. The options read are
|
|
inserted in place of the original @<I>file</I> option. If <I>file</I>
|
|
does not exist, or cannot be read, then the option will be treated
|
|
literally, and not removed.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Options in <I>file</I> are separated by whitespace. A whitespace
|
|
character may be included in an option by surrounding the entire
|
|
option in either single or double quotes. Any character (including a
|
|
backslash) may be included by prefixing the character to be included
|
|
with a backslash. The <I>file</I> may itself contain additional
|
|
@<I>file</I> options; any such options will be processed recursively.
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?1+ar">ar</A></B>(1), <B><A HREF="/cgi-bin/man/man2html?1+nm">nm</A></B>(1), <B><A HREF="/cgi-bin/man/man2html?1+objdump">objdump</A></B>(1), <B><A HREF="/cgi-bin/man/man2html?1+ranlib">ranlib</A></B>(1), <B><A HREF="/cgi-bin/man/man2html?1+readelf">readelf</A></B>(1)
|
|
and the Info entries for <I>binutils</I>.
|
|
<A NAME="lbAG"> </A>
|
|
<H2>COPYRIGHT</H2>
|
|
|
|
|
|
|
|
Copyright (c) 1991-2020 Free Software Foundation, Inc.
|
|
<P>
|
|
|
|
Permission is granted to copy, distribute and/or modify this document
|
|
under the terms of the <FONT SIZE="-1">GNU</FONT> Free Documentation License, Version 1.3
|
|
or any later version published by the Free Software Foundation;
|
|
with no Invariant Sections, with no Front-Cover Texts, and with no
|
|
Back-Cover Texts. A copy of the license is included in the
|
|
section entitled ``<FONT SIZE="-1">GNU</FONT> Free Documentation License''.
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="27"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="28"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="29"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="30"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="31"><A HREF="#lbAF">SEE ALSO</A><DD>
|
|
<DT id="32"><A HREF="#lbAG">COPYRIGHT</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:27 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|