Strings (Unix): Difference between revisions

Content deleted Content added
add short desc
Make first paragraph longer by merging with second
Line 21:
| website =
}}
The<code>'''strings'''</code> is a [[shell (computing)|shell]] [[shell (computing)|command]] that extracts [[printable character]] [[String (computer science)|strings]] from a [[computer file|file]] {{endash}} which canis beparticular useful for analyzing the informationcontent inof a [[binary file]]. By definition, a binary file contains data that is not printable text yet a binary file often does contain some printable character text {{endash}} often in relatively short sequences distributed throughout the file. These portions of the binary file can be informative as to what the file contains overall. For a [[text file]], a file containing all printable characters, the command prints the entire file content, and therefore, provides no utility over more commonly used file output commands such as <code>[[cat (Unix)|cat]]</code>.
<code>'''strings'''</code> is a [[shell (computing)|shell]] [[shell (computing)|command]] that searches a [[computer file|file]] for [[printable character]] [[String (computer science)|strings]] and writes them to [[standard output]].
 
The command can be useful for analyzing the information in a [[binary file]]. By definition, a binary file contains data that is not printable text yet a binary file often does contain some printable character text {{endash}} often in relatively short sequences distributed throughout the file. These portions of the binary file can be informative as to what the file contains overall. For a [[text file]], a file containing all printable characters, the command prints the entire file content, and therefore, provides no utility over more commonly used file output commands such as <code>[[cat (Unix)|cat]]</code>.
 
The command searches for sequences of printable characters that end with a [[null-terminated string|NUL character]] but ignores any sequence that is less than a specified length or 4 characters by default. Some implementations provide options for determining what is recognized as a printable character, which is useful for finding non-[[ASCII]] and [[wide character]] text. By default, it only selects strings from the initialized and loaded sections of an object file. For other types of files, it selects strings from the whole file.