📄 strings.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>strings</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_001_014_2087"> </a>NAME</h4><blockquote>strings - find printable strings in files</blockquote><h4><a name = "tag_001_014_2088"> </a>SYNOPSIS</h4><blockquote><pre><code>strings <b>[</b>-a<b>][</b>-t <i>format</i><b>][</b>-n <i>number</i><b>][</b><i>file</i>...<b>]</b>strings <b>[</b>-<b>][</b>-t <i>format</i><b>][</b>-<i>number</i><b>][</b><i>file</i>...<b>]</b></code></pre></blockquote><h4><a name = "tag_001_014_2089"> </a>DESCRIPTION</h4><blockquote>The<i>strings</i>utility looks for printable strings in regular files andwrites those strings to standard output.A printable string is any sequenceof four (by default) or moreprintable characters terminated by anewlineor NUL character.Additional implementation-dependent strings may be written.(See<i><a href="localedef.html">localedef</a></i>.)</blockquote><h4><a name = "tag_001_014_2090"> </a>OPTIONS</h4><blockquote>The<i>strings</i>utility supports the <b>XBD</b> specification, <a href="../xbd/utilconv.html#usg"><b>Utility Syntax Guidelines</b> </a> except that the obsolescent version uses "-"in a non-standard way and allows a multi-digit option,<b>-</b><i>number</i>.<p>The following options are supported:<dl compact><dt><b>-a</b><dd><dt><b>-</b><dd>Scan files in their entirety.If<b>-a</b>is not specified, it isimplementation-dependentwhat portion of each file isscanned for strings.<dt><b>-n </b><i>number</i><dd><dt><i>-number</i><dd>Specify the minimum string length, where the<i>number</i>argument is a positive decimal integer.The default is 4.<dt><b>-t </b><i>format</i><dd>Write each string preceded by its byte offsetfrom the start of the file.The format is dependent on the singlecharacter used as the<i>format</i>option-argument:<dl compact><dt><b>d</b><dd>The offset will be written in decimal.<dt><b>o</b><dd>The offset will be written in octal.<dt><b>x</b><dd>The offset will be written in hexadecimal.</dl><p></dl></blockquote><h4><a name = "tag_001_014_2091"> </a>OPERANDS</h4><blockquote>The following operand is supported:<dl compact><dt><i>file</i><dd>A pathname of a regular file to be used as input.If no<i>file</i>operand is specified, the<i>strings</i>utility will read from the standard input.</dl></blockquote><h4><a name = "tag_001_014_2092"> </a>STDIN</h4><blockquote>See the INPUT FILES section.</blockquote><h4><a name = "tag_001_014_2093"> </a>INPUT FILES</h4><blockquote>The input files named by the utility arguments or thestandard input must be regular files of any format.</blockquote><h4><a name = "tag_001_014_2094"> </a>ENVIRONMENT VARIABLES</h4><blockquote>The following environment variables affect the execution of<i>strings</i>:<dl compact><dt><i>LANG</i><dd>Provide a default value for the internationalisation variablesthat are unset or null.If<i>LANG</i>is unset or null, the corresponding value from theimplementation-dependent default locale will be used.If any of the internationalisation variables contains an invalid setting, theutility will behave as if none of the variables had been defined.<dt><i>LC_ALL</i><dd>If set to a non-empty string value,override the values of all the other internationalisation variables.<dt><i>LC_CTYPE</i><dd>Determine thelocale for the interpretation of sequences of bytes of text data ascharacters (for example, single- as opposed to multi-byte charactersin arguments and input files)and to identify printable strings.<dt><i>LC_MESSAGES</i><dd>Determine the locale that should be used to affectthe format and contents of diagnosticmessages written to standard error.<dt><i>NLSPATH</i><dd>Determine the location of message cataloguesfor the processing of<i>LC_MESSAGES .</i></dl></blockquote><h4><a name = "tag_001_014_2095"> </a>ASYNCHRONOUS EVENTS</h4><blockquote>Default.</blockquote><h4><a name = "tag_001_014_2096"> </a>STDOUT</h4><blockquote>Strings found are written to the standard output, one per line.<p>When the<b>-t</b>option is not specified, the format of the output is:<p><code><tt>"%s"</tt>, <<i>string</i>></code><p>With the<b>-t o</b>option, the format of the output is:<p><code><tt>"%o %s"</tt>, <<i>byte offset</i>>,<<i>string</i>></code><p>With the<b>-t x</b>option, the format of the output is:<p><code><tt>"%x %s"</tt>, <<i>byte offset</i>>,<<i>string</i>></code><p>With the<b>-t d</b>option, the format of the output is:<p><code><tt>"%d %s"</tt>, <<i>byte offset</i>>,<<i>string</i>></code></blockquote><h4><a name = "tag_001_014_2097"> </a>STDERR</h4><blockquote>Used only for diagnostic messages.</blockquote><h4><a name = "tag_001_014_2098"> </a>OUTPUT FILES</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_2099"> </a>EXTENDED DESCRIPTION</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_2100"> </a>EXIT STATUS</h4><blockquote>The following exit values are returned:<dl compact><dt>0<dd>Successful completion.<dt>>0<dd>An error occurred.</dl></blockquote><h4><a name = "tag_001_014_2101"> </a>CONSEQUENCES OF ERRORS</h4><blockquote>Default.</blockquote><h4><a name = "tag_001_014_2102"> </a>APPLICATION USAGE</h4><blockquote>By default the data area (as opposed to the text, "bss"or header areas) of a binary executable file is scanned.Implementations will document which areas are scanned.<p>Some historical implementations do not require NUL ornewline characterterminators for strings to permit those languages thatdo not use NUL as a string terminator to have theirstrings written.</blockquote><h4><a name = "tag_001_014_2103"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_2104"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_2105"> </a>SEE ALSO</h4><blockquote><i><a href="nm.html">nm</a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -