strings - print the strings of printable characters in files.

strings [ various options] file

Outputs printable character sequences that are at least min-len long (default=4) and followed by an unprintable character.
For object (i.e. load modules), only prints the strings from the initialized and loaded sections by default.
Useful for determining the contents of non-text files.
-min-len
-n min-len
--bytes=min-len
sequences of characters must be are at least min-len characters long, default 4.
-f
--print-file-name
Output the name of the file before each string.
-t radix
--radix=radix
Output the offset within the file before each string.
o for octal, x for hexadecimal, or d for decimal.
-o o radix. other versions of strings have -o use decminal
-a
--all
Do not scan only the initialized and loaded sections of object files; scan the whole files.
-e encoding
--encoding=encoding
Specify the character encoding of the strings
  • s = single-7-bit-byte characters (ASCII, ISO 8859, etc., default),
  • S = single-8-bit-byte characters,
  • b = 16-bit bigendian,
  • B = 32-bit bigendian,
  • L = 32-bit littleendian. Useful for finding wide character strings.
  • l = 16-bit littleendian, (unicode)
--target=bfdname Specify an object code format other than your system's default format.
-v, --version
--help

Helpful syntax to show most frequently occuring strings:

strings file | sort | uniq -c | sort -d | more

Show most frequently words in a text file.
( translate spaces to NULL to cause to break up by words.

tr ' ' '\000' < file | strings | sort | uniq -c | sort -r | more

SEE ar, nm, objdump, ranlib, readelf

OS X

uses Xcode and needs "active developer path" see Xcode

binutils-2.14.90.0.4 2006-01-11 STRINGS(1) 341,1 Bot