strings(1) strings(1)
NAME
strings - find printable strings in object or binary files
SYNOPSIS
strings [-a] [-o|-t format] [-n number] [--] file ...
DESCRIPTION
strings looks for strings in binary files and writes them on standard
output. A string is by default any sequence of 4 or more printable
ASCII characters ending with a newline or a null byte [see ascii(5)].
strings is useful for identifying random object files and many other
things.
OPTIONS
-a strings searches the entire file for printable strings.
This corresponds to the old option -, which is still supported.
-a not specified:
strings only looks in the initialized data space of object files.
-o strings precedes each string by its offset in the file.
-t format
Each string is output preceded by its offset in the file. The
format of the positioning specification is defined as follows:
d Decimal positioning specification
o Octal positioning specification
x Hexadecimal positioning specification
-n number
Defines a strings as any sequence of number or more printable
characters ending with a newline or a null byte.
This corresponds to the old option -number, which is still sup-
ported.
-n not specified:
A string is any sequence of 4 or more printable characters ending
with a newline character or a null byte.
-- End of the list of options. Must be specified if file begins with
-.
file Name of the file in which strings is to look for printable
strings.
Page 1 Reliant UNIX 5.44 Printed 11/98
strings(1) strings(1)
LOCALE
The LCMESSAGES environment variable governs the language in which
message texts are displayed. If LCMESSAGES is undefined or is defined
as the null string, it defaults to the value of LANG. If LANG is like-
wise undefined or null, the system acts as if it were not internation-
alized.
The LCALL environment variable governs the entire locale. LCALL
takes precedence over all the other environment variables which affect
internationalization.
EXAMPLES
Finding all printable strings in the executable binary file a.out:
$ strings a.out
Hello, user
This could be the output for a file that originally held the following
source code:
#include <stdio.h>
main()
{
printf("Hello, user\n");
}
SEE ALSO
nm(1), od(1), ascii(5).
Page 2 Reliant UNIX 5.44 Printed 11/98