logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

strings.1p (6829B)


  1. '\" et
  2. .TH STRINGS "1P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. strings
  12. \(em find printable strings in files
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. strings \fB[\fR-a\fB] [\fR-t \fIformat\fB] [\fR-n \fInumber\fB] [\fIfile\fR...\fB]\fR
  17. .fi
  18. .SH DESCRIPTION
  19. The
  20. .IR strings
  21. utility shall look for printable strings in regular files and shall
  22. write those strings to standard output. A printable string is any
  23. sequence of four (by default) or more printable characters terminated
  24. by a
  25. <newline>
  26. or NUL character. Additional implementation-defined strings may be
  27. written; see
  28. .IR localedef .
  29. .P
  30. If the first argument is
  31. .BR '\-' ,
  32. the results are unspecified.
  33. .SH OPTIONS
  34. The
  35. .IR strings
  36. utility shall conform to the Base Definitions volume of POSIX.1\(hy2017,
  37. .IR "Section 12.2" ", " "Utility Syntax Guidelines",
  38. except for the unspecified usage of
  39. .BR '\-' .
  40. .P
  41. The following options shall be supported:
  42. .IP "\fB\-a\fP" 10
  43. Scan files in their entirety. If
  44. .BR \-a
  45. is not specified, it is implementation-defined what portion of each
  46. file is scanned for strings.
  47. .IP "\fB\-n\ \fInumber\fR" 10
  48. Specify the minimum string length, where the
  49. .IR number
  50. argument is a positive decimal integer. The default shall be 4.
  51. .IP "\fB\-t\ \fIformat\fR" 10
  52. Write each string preceded by its byte offset from the start of the
  53. file. The format shall be dependent on the single character used as
  54. the
  55. .IR format
  56. option-argument:
  57. .RS 10
  58. .IP "\fRd\fR" 6
  59. The offset shall be written in decimal.
  60. .IP "\fRo\fR" 6
  61. The offset shall be written in octal.
  62. .IP "\fRx\fR" 6
  63. The offset shall be written in hexadecimal.
  64. .RE
  65. .SH OPERANDS
  66. The following operand shall be supported:
  67. .IP "\fIfile\fR" 10
  68. A pathname of a regular file to be used as input. If no
  69. .IR file
  70. operand is specified, the
  71. .IR strings
  72. utility shall read from the standard input.
  73. .SH STDIN
  74. See the INPUT FILES section.
  75. .SH "INPUT FILES"
  76. The input files named by the utility arguments or the standard input
  77. shall be regular files of any format.
  78. .SH "ENVIRONMENT VARIABLES"
  79. The following environment variables shall affect the execution of
  80. .IR strings :
  81. .IP "\fILANG\fP" 10
  82. Provide a default value for the internationalization variables that are
  83. unset or null. (See the Base Definitions volume of POSIX.1\(hy2017,
  84. .IR "Section 8.2" ", " "Internationalization Variables"
  85. for the precedence of internationalization variables used to determine
  86. the values of locale categories.)
  87. .IP "\fILC_ALL\fP" 10
  88. If set to a non-empty string value, override the values of all the
  89. other internationalization variables.
  90. .IP "\fILC_CTYPE\fP" 10
  91. Determine the locale for the interpretation of sequences of bytes of
  92. text data as characters (for example, single-byte as opposed to
  93. multi-byte characters in arguments and input files) and to identify
  94. printable strings.
  95. .IP "\fILC_MESSAGES\fP" 10
  96. .br
  97. Determine the locale that should be used to affect the format and
  98. contents of diagnostic messages written to standard error.
  99. .IP "\fINLSPATH\fP" 10
  100. Determine the location of message catalogs for the processing of
  101. .IR LC_MESSAGES .
  102. .SH "ASYNCHRONOUS EVENTS"
  103. Default.
  104. .SH STDOUT
  105. Strings found shall be written to the standard output, one per line.
  106. .P
  107. When the
  108. .BR \-t
  109. option is not specified, the format of the output shall be:
  110. .sp
  111. .RS 4
  112. .nf
  113. "%s", <\fIstring\fR>
  114. .fi
  115. .P
  116. .RE
  117. .P
  118. With the
  119. .BR "\-t\ o"
  120. option, the format of the output shall be:
  121. .sp
  122. .RS 4
  123. .nf
  124. "%o %s", <\fIbyte offset\fR>, <\fIstring\fR>
  125. .fi
  126. .P
  127. .RE
  128. .P
  129. With the
  130. .BR "\-t\ x"
  131. option, the format of the output shall be:
  132. .sp
  133. .RS 4
  134. .nf
  135. "%x %s", <\fIbyte offset\fR>, <\fIstring\fR>
  136. .fi
  137. .P
  138. .RE
  139. .P
  140. With the
  141. .BR "\-t\ d"
  142. option, the format of the output shall be:
  143. .sp
  144. .RS 4
  145. .nf
  146. "%d %s", <\fIbyte offset\fR>, <\fIstring\fR>
  147. .fi
  148. .P
  149. .RE
  150. .SH STDERR
  151. The standard error shall be used only for diagnostic messages.
  152. .SH "OUTPUT FILES"
  153. None.
  154. .SH "EXTENDED DESCRIPTION"
  155. None.
  156. .SH "EXIT STATUS"
  157. The following exit values shall be returned:
  158. .IP "\00" 6
  159. Successful completion.
  160. .IP >0 6
  161. An error occurred.
  162. .SH "CONSEQUENCES OF ERRORS"
  163. Default.
  164. .LP
  165. .IR "The following sections are informative."
  166. .SH "APPLICATION USAGE"
  167. By default the data area (as opposed to the text, ``bss'', or header
  168. areas) of a binary executable file is scanned. Implementations
  169. document which areas are scanned.
  170. .P
  171. Some historical implementations do not require NUL or
  172. <newline>
  173. terminators for strings to permit those languages that do not use NUL
  174. as a string terminator to have their strings written.
  175. .SH EXAMPLES
  176. None.
  177. .SH RATIONALE
  178. Apart from rationalizing the option syntax and slight difficulties with
  179. object and executable binary files,
  180. .IR strings
  181. is specified to match historical practice closely. The
  182. .BR \-a
  183. and
  184. .BR \-n
  185. options were introduced to replace the non-conforming
  186. .BR \-
  187. and
  188. .BR \- \c
  189. .IR number
  190. options. These options are no longer specified by POSIX.1\(hy2008 but
  191. may be present in some implementations.
  192. .P
  193. The
  194. .BR \-o
  195. option historically means different things on different
  196. implementations. Some use it to mean ``\c
  197. .IR offset
  198. in decimal'', while others use it as ``\c
  199. .IR offset
  200. in octal''. Instead of trying to decide which way would be least
  201. objectionable, the
  202. .BR \-t
  203. option was added. It was originally named
  204. .BR \-O
  205. to mean ``offset'', but was changed to
  206. .BR \-t
  207. to be consistent with
  208. .IR od .
  209. .P
  210. The ISO\ C standard function
  211. \fIisprint\fR()
  212. is restricted to a domain of
  213. .BR "unsigned char" .
  214. This volume of POSIX.1\(hy2017 requires implementations to write strings as defined by the
  215. current locale.
  216. .SH "FUTURE DIRECTIONS"
  217. None.
  218. .SH "SEE ALSO"
  219. .IR "\fIlocaledef\fR\^",
  220. .IR "\fInm\fR\^"
  221. .P
  222. The Base Definitions volume of POSIX.1\(hy2017,
  223. .IR "Chapter 8" ", " "Environment Variables",
  224. .IR "Section 12.2" ", " "Utility Syntax Guidelines"
  225. .\"
  226. .SH COPYRIGHT
  227. Portions of this text are reprinted and reproduced in electronic form
  228. from IEEE Std 1003.1-2017, Standard for Information Technology
  229. -- Portable Operating System Interface (POSIX), The Open Group Base
  230. Specifications Issue 7, 2018 Edition,
  231. Copyright (C) 2018 by the Institute of
  232. Electrical and Electronics Engineers, Inc and The Open Group.
  233. In the event of any discrepancy between this version and the original IEEE and
  234. The Open Group Standard, the original IEEE and The Open Group Standard
  235. is the referee document. The original Standard can be obtained online at
  236. http://www.opengroup.org/unix/online.html .
  237. .PP
  238. Any typographical or formatting errors that appear
  239. in this page are most likely
  240. to have been introduced during the conversion of the source files to
  241. man page format. To report such errors, see
  242. https://www.kernel.org/doc/man-pages/reporting_bugs.html .