| <html lang="en"> | |
| <head> | |
| <title>strings - GNU Binary Utilities</title> | |
| <meta http-equiv="Content-Type" content="text/html"> | |
| <meta name="description" content="GNU Binary Utilities"> | |
| <meta name="generator" content="makeinfo 4.13"> | |
| <link title="Top" rel="start" href="index.html#Top"> | |
| <link rel="prev" href="size.html#size" title="size"> | |
| <link rel="next" href="strip.html#strip" title="strip"> | |
| <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> | |
| <!-- | |
| Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, | |
| 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, | |
| 2010, 2011, 2012, 2013 | |
| Free Software Foundation, Inc. | |
| Permission is granted to copy, distribute and/or modify this document | |
| under the terms of the GNU 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 ``GNU Free Documentation License''. | |
| --> | |
| <meta http-equiv="Content-Style-Type" content="text/css"> | |
| <style type="text/css"><!-- | |
| pre.display { font-family:inherit } | |
| pre.format { font-family:inherit } | |
| pre.smalldisplay { font-family:inherit; font-size:smaller } | |
| pre.smallformat { font-family:inherit; font-size:smaller } | |
| pre.smallexample { font-size:smaller } | |
| pre.smalllisp { font-size:smaller } | |
| span.sc { font-variant:small-caps } | |
| span.roman { font-family:serif; font-weight:normal; } | |
| span.sansserif { font-family:sans-serif; font-weight:normal; } | |
| --></style> | |
| </head> | |
| <body> | |
| <div class="node"> | |
| <a name="strings"></a> | |
| <p> | |
| Next: <a rel="next" accesskey="n" href="strip.html#strip">strip</a>, | |
| Previous: <a rel="previous" accesskey="p" href="size.html#size">size</a>, | |
| Up: <a rel="up" accesskey="u" href="index.html#Top">Top</a> | |
| <hr> | |
| </div> | |
| <h2 class="chapter">7 strings</h2> | |
| <p><a name="index-strings-123"></a><a name="index-listings-strings-124"></a><a name="index-printing-strings-125"></a><a name="index-strings_002c-printing-126"></a> | |
| <!-- man title strings print the strings of printable characters in files. --> | |
| <pre class="smallexample"> <!-- man begin SYNOPSIS strings --> | |
| strings [<samp><span class="option">-afovV</span></samp>] [<samp><span class="option">-</span></samp><var>min-len</var>] | |
| [<samp><span class="option">-n</span></samp> <var>min-len</var>] [<samp><span class="option">--bytes=</span></samp><var>min-len</var>] | |
| [<samp><span class="option">-t</span></samp> <var>radix</var>] [<samp><span class="option">--radix=</span></samp><var>radix</var>] | |
| [<samp><span class="option">-e</span></samp> <var>encoding</var>] [<samp><span class="option">--encoding=</span></samp><var>encoding</var>] | |
| [<samp><span class="option">-</span></samp>] [<samp><span class="option">--all</span></samp>] [<samp><span class="option">--print-file-name</span></samp>] | |
| [<samp><span class="option">-T</span></samp> <var>bfdname</var>] [<samp><span class="option">--target=</span></samp><var>bfdname</var>] | |
| [<samp><span class="option">--help</span></samp>] [<samp><span class="option">--version</span></samp>] <var>file</var>... | |
| <!-- man end --> | |
| </pre> | |
| <!-- man begin DESCRIPTION strings --> | |
| <p>For each <var>file</var> given, <span class="sc">gnu</span> <samp><span class="command">strings</span></samp> 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. By default, it only prints the strings from the initialized | |
| and loaded sections of object files; for other types of files, it prints | |
| the strings from the whole file. | |
| <p><samp><span class="command">strings</span></samp> is mainly useful for determining the contents of non-text | |
| files. | |
| <!-- man end --> | |
| <!-- man begin OPTIONS strings --> | |
| <dl> | |
| <dt><samp><span class="env">-a</span></samp><dt><samp><span class="env">--all</span></samp><dt><samp><span class="env">-</span></samp><dd>Do not scan only the initialized and loaded sections of object files; | |
| scan the whole files. | |
| <br><dt><samp><span class="env">-f</span></samp><dt><samp><span class="env">--print-file-name</span></samp><dd>Print the name of the file before each string. | |
| <br><dt><samp><span class="env">--help</span></samp><dd>Print a summary of the program usage on the standard output and exit. | |
| <br><dt><samp><span class="env">-</span><var>min-len</var></samp><dt><samp><span class="env">-n </span><var>min-len</var></samp><dt><samp><span class="env">--bytes=</span><var>min-len</var></samp><dd>Print sequences of characters that are at least <var>min-len</var> characters | |
| long, instead of the default 4. | |
| <br><dt><samp><span class="env">-o</span></samp><dd>Like ‘<samp><span class="samp">-t o</span></samp>’. Some other versions of <samp><span class="command">strings</span></samp> have <samp><span class="option">-o</span></samp> | |
| act like ‘<samp><span class="samp">-t d</span></samp>’ instead. Since we can not be compatible with both | |
| ways, we simply chose one. | |
| <br><dt><samp><span class="env">-t </span><var>radix</var></samp><dt><samp><span class="env">--radix=</span><var>radix</var></samp><dd>Print the offset within the file before each string. The single | |
| character argument specifies the radix of the offset—‘<samp><span class="samp">o</span></samp>’ for | |
| octal, ‘<samp><span class="samp">x</span></samp>’ for hexadecimal, or ‘<samp><span class="samp">d</span></samp>’ for decimal. | |
| <br><dt><samp><span class="env">-e </span><var>encoding</var></samp><dt><samp><span class="env">--encoding=</span><var>encoding</var></samp><dd>Select the character encoding of the strings that are to be found. | |
| Possible values for <var>encoding</var> are: ‘<samp><span class="samp">s</span></samp>’ = single-7-bit-byte | |
| characters (ASCII, ISO 8859, etc., default), ‘<samp><span class="samp">S</span></samp>’ = | |
| single-8-bit-byte characters, ‘<samp><span class="samp">b</span></samp>’ = 16-bit bigendian, ‘<samp><span class="samp">l</span></samp>’ = | |
| 16-bit littleendian, ‘<samp><span class="samp">B</span></samp>’ = 32-bit bigendian, ‘<samp><span class="samp">L</span></samp>’ = 32-bit | |
| littleendian. Useful for finding wide character strings. (‘<samp><span class="samp">l</span></samp>’ | |
| and ‘<samp><span class="samp">b</span></samp>’ apply to, for example, Unicode UTF-16/UCS-2 encodings). | |
| <br><dt><samp><span class="env">-T </span><var>bfdname</var></samp><dt><samp><span class="env">--target=</span><var>bfdname</var></samp><dd><a name="index-object-code-format-127"></a>Specify an object code format other than your system's default format. | |
| See <a href="Target-Selection.html#Target-Selection">Target Selection</a>, for more information. | |
| <br><dt><samp><span class="env">-v</span></samp><dt><samp><span class="env">-V</span></samp><dt><samp><span class="env">--version</span></samp><dd>Print the program version number on the standard output and exit. | |
| </dl> | |
| <!-- man end --> | |
| </body></html> | |