Jump to content

strings (Unix)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by DannyS712 bot (talk | contribs) at 18:35, 11 May 2020 (Task 70: Update syntaxhighlight tags - remove use of deprecated <source> tags). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
strings
Operating systemUnix and Unix-like
TypeCommand

In computer software, strings is a program in Unix-like operating systems that finds and prints text strings embedded in binary files such as executables. It can be used on object files and core dumps.

Overview

Strings are recognized by looking for sequences of at least 4 (by default) printable characters terminating in a NUL character (that is, null-terminated strings). Some implementations provide options for determining what is recognized as a printable character, which is useful for finding non-ASCII and wide character text.

Common usage includes piping its output to grep and fold or redirecting the output to a file.[1]

It is part of the GNU Binary Utilities (binutils), and has been ported to other operating systems including Windows.[2]

Example

Using strings to print sequences of characters that are at least 8 characters long (this command prints the system's BIOS information; should be run as root):

dd if=/dev/mem bs=1k skip=768 count=256 2>/dev/null | strings -n 8 | less

See also

References

  1. ^ Kiddle, Oliver; Jerry Peek; Peter Stephenson (2005). From Bash to Z Shell. New York, NY: Apress. p. 413. ISBN 978-1-590-59376-9. OCLC 57450917.
  2. ^ cygwin