strings

find printable strings in files (POSIX)

Syntax:

strings [-O format] [-a] [-n number] [file...]

Options:

-a
Scan files in their entirety.
-n number
Search for strings that are number characters or longer. The number argument is a positive decimal integer (default is 4 characters).
-O format
Write each string, prefixed by its offset (in bytes). The format argument controls the number system used to print the offset:
To print in: Specify:
octalo
hexx
decimald
The default is octal.
file
The pathname of a file to be used as input. If no files are specified, strings reads from the standard input.

Examples:

For the file /.boot, output all printable strings equal to or longer than four characters and prefix each line with the octal offset from the beginning of the file:

    strings /.boot

Output all printable strings equal to or longer than 10 characters and prefix the line with the hex offset from the beginning of the file:

    strings -Ox -n10 /.boot

Description:

The strings utility looks for printable strings in regular files and writes those strings to standard output, one per line. A printable string is any sequence of number or more characters followed by a newline or NUL character.

The QNX implementation of strings always scans the entire file. The -a option is meant for portability with other implementations that may not do so by default.

Exit status:

0
Successful completion.
>0
An error occurred.