Strings

From LQWiki
Jump to navigation Jump to search

strings(1)

The strings(1) program is specified as part of the Single Unix Specification version 4 (also known as The Open Group Base Specifications Issue 7, and IEEE Std 1003.1-2008,) and also part of at least some of the earlier versions, as one of "the [...] utilities offered by POSIX-conformant systems". It has been present in some if not all Unix systems since before POSIX.

The purpose of the utility is to search in binary files for textual information in the native text format of the system. This is often used on executable files as a way, among other things, of determining important file names, error messages and such without having to actually encounter them (the error messages, I mean). Binary files of all sorts are very hard to scan by eye using regular text tools, partly because the file tends to be much larger than the text portions, but about 1/3 of its bytes are likely to look like text characters when taken individually. However, Unix mainly supports the C language notion of a string, which is a sequence of text bytes terminated by a NUL (zero) character. Accordingly, the strings(1) utility looks for an unbroken sequence of text characters immediately followed by a NUL, and show only the ones that meet a minimum length requirement (typically 4 text bytes), thus reducing the human operator's search space considerably.

See Also

External Links

  • [1] Single Unix Specification, Version 4 (SUSV4). Referenced 22 Mar 2011. Downloadable.
  • [2] Wikipedia's take on the Single Unix Specification.
  • [3] Wikipedia's take on The Open Group and its history.