maux
Star on GitHub Buy me a coffee

Manual / strings

strings(1)

STRINGS(1) General Commands Manual STRINGS(1)

strings - find printable strings in a file

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

Strings prints every run of number (default 4, capped at 255 in this implementation) or more printable bytes in file (standard input if none is given), each terminated by a non-printable byte or end of file — the terminator itself is never printed. With more than one file operand, each is scanned in turn with no header between them, matching this project's BSD reference.

A byte is printable if it falls in $20-$7E (plain ASCII) OR $A0-$FE (this tree's own high-bit text convention) — a raw file has no liba string convention of its own, so both count. A qualifying byte is written to standard output with its high bit set, this tree's own text convention, regardless of which half of that rule it qualified under.

-a is accepted and does nothing: this implementation has no object-file section table to restrict to, so the whole file is always scanned.

-t format prefixes each string with its byte offset from the start of file (resetting to 0 per file), as a bare number with no leading zeros: d decimal, o octal, x lower-case hexadecimal.

/usr/man/STRINGS this page

od(1)

Exit status is 0; 1 if any file operand could not be opened (the rest are still scanned); 2 for a usage error (an unrecognised option, a non-numeric or out-of-range -n, or a -t argument other than a single d, o, or x).

-n number is capped at 255 (see above) — a longer minimum is refused as a usage error rather than honoured.

September 15, 2026 maux