strings—finds any printable strings in an object or binary file

strings [ –a|-|--all ] [-f|--print-file-name] [ –o ] [--help]
   [ –v|--version ] [-n min-len| min-len|--bytes=min-len]
   [-t  {o,x,d} [--target=bfdname] [--radix={o,x,d}|] filename…]

The strings command looks for ASCII strings in a binary file. A string is any sequence of four or more printing characters ending with a newline or a null character. strings is useful for identifying random object files and many other things.

Example A.55.
					strings /bin/nawk | head -2
				

Explanation

Prints any ASCII text in the first two lines of the binary executable /bin/nawk.

Get Linux Shells by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.