Strings (Unix): Difference between revisions

Content deleted Content added
mNo edit summary
Undid revision 838509253 by Justonce12 (talk)
Line 3:
In [[computer software]], '''strings''' is a program in [[Unix-like]] [[operating system]]s that finds and prints text [[string (computer science)|strings]] embedded in [[binary files]] such as executables. It can be used on object files and [[core dump]]s.
 
<code>Strings</code> are recognized by looking for sequences of at least 4 (by default) printable characters terminating in a NUL character (that is, [[null-terminated string]]s). 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 <tt>[[grep|<code>grep]]</codett>]] and <tt>[[Fold (Unix)|fold]]</tt> or redirecting the output to a [[Computer file|<code>file</code>]].<ref>{{cite book|last=Kiddle|first=Oliver |author2=Jerry Peek |author3=Peter Stephenson|title=From Bash to Z Shell |year=2005 |___location=New York, NY |publisher=Apress|isbn=978-1-590-59376-9|page=413 |oclc=57450917 |url=http://www.apress.com/9781590593769}}</ref>
 
It is part of the [[GNU Binary Utilities]] (binutils), and has been ported to other operating systems including [[Microsoft Windows]].<ref>[[cygwin]]</ref>
 
==Example==
Using <code>''strings</code>'' 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):
<source lang="bash">
dd if=/dev/mem bs=1k skip=768 count=256 2>/dev/null | strings -n 8 | less