Sign in

strings(1) on Solnix vs Linux and the BSDs

On Solnix, strings is the illumos strings at /usr/bin/strings, with only -a, -n, -N, -o and -t. The biggest trap is -o: on Solnix it means -t d (decimal offsets), but on Linux, FreeBSD and OpenBSD it means -t o (octal).

What Solnix runs

A default Solnix system runs the illumos strings at /usr/bin/strings. No other illumos variants are shipped. GNU strings is available from pkgs.solnix.binutils, installed as gstrings, and its page calls it strings. It is not the command on PATH by default.

Differences

Compared withTopicWhat differs
Linux, FreeBSD, OpenBSD-o meaningSolnix strings -o is equivalent to -t d, so offsets are decimal. On Linux, FreeBSD and OpenBSD, -o is equivalent to -t o, so offsets are octal. The same command line prints different offsets.
Source: illumos strings(1) -o; Linux strings(1) -o; FreeBSD strings(1) -o; OpenBSD strings(1) -o
Linuxgstrings is GNU stringsThe gstrings page from pkgs.solnix.binutils has the same synopsis and options as the Linux strings page: it is GNU strings, the same program. Linux behaviour applies to gstrings, not to /usr/bin/strings.
Source: Solnix gstrings(1) from pkgs.solnix.binutils SYNOPSIS, OPTIONS; Linux strings(1) SYNOPSIS, OPTIONS
Linux, FreeBSD, OpenBSDno long optionsThe Solnix synopsis lists only short options. It has no --all, --bytes, --radix, --print-file-name, --help or --version. Linux, FreeBSD and OpenBSD document these long forms.
Source: illumos strings(1) SYNOPSIS; Linux strings(1) OPTIONS; FreeBSD strings(1) SYNOPSIS; OpenBSD strings(1) SYNOPSIS
Linux, FreeBSD, OpenBSD-f file name prefixSolnix strings has no -f to print the file name before each string. Linux, FreeBSD and OpenBSD all document -f / --print-file-name.
Source: illumos strings(1) SYNOPSIS, OPTIONS; Linux, FreeBSD and OpenBSD strings(1) -f
Linux, FreeBSD, OpenBSDno -e encodingSolnix strings looks for ASCII strings and has no -e option. Linux, FreeBSD and OpenBSD select 7-bit, 8-bit, 16-bit or 32-bit encodings with -e, which is how you find wide-character strings.
Source: illumos strings(1) DESCRIPTION; Linux strings(1) -e; FreeBSD strings(1) -e; OpenBSD strings(1) -e
Linux, FreeBSD, OpenBSD-v and -hOn Linux, FreeBSD and OpenBSD, -v prints the version; Linux also accepts -V for the version, and FreeBSD uses -h for help. The Solnix page documents neither -v nor -h.
Source: Linux strings(1) -v, -V; FreeBSD strings(1) -h, -v; OpenBSD strings(1) -v; illumos strings(1) OPTIONS
Linux, FreeBSD, OpenBSD-N section filterSolnix -N name restricts the search to the named ELF section, may be repeated and is ignored with -a; the page says no standard specifies it. The Linux, FreeBSD and OpenBSD pages have no equivalent.
Source: illumos strings(1) -N, ATTRIBUTES; Linux strings(1) OPTIONS; FreeBSD strings(1) DESCRIPTION; OpenBSD strings(1) OPTIONS
Linuxmeaning of lone -On Solnix, a lone - is interchangeable with -a. On Linux, - is position dependent: it forces a full scan only of files named after it, even if -d was given.
Source: illumos strings(1) NOTES, -a; Linux strings(1) -a, DESCRIPTION
Linuxdefault scan scopeBy default Solnix scans sections of type SHT_PROGBITS that have the SHF_ALLOC flag; -a scans everywhere. The Linux page says the default depends on how strings was configured, and offers -d for data sections only.
Source: illumos strings(1) DESCRIPTION; Linux strings(1) DESCRIPTION, -d
Linux, FreeBSD, OpenBSDwhat ends a stringSolnix strings end at a NEWLINE or NULL. The Linux page says strings end at control characters such as newline and carriage return but not tab, and -w includes other whitespace. FreeBSD and OpenBSD say only 'followed by an unprintable character'.
Source: illumos strings(1) DESCRIPTION; Linux strings(1) -n, -w; FreeBSD strings(1) DESCRIPTION; OpenBSD strings(1) DESCRIPTION
Linux, OpenBSD@file option filesThe Linux and OpenBSD pages document @file, which reads command-line options from a file. The Solnix page documents no such feature.
Source: Linux strings(1) @file; OpenBSD strings(1) @file; illumos strings(1) OPTIONS

Everyday tasks

TaskSolnixLinuxFreeBSDOpenBSD
print the printable strings in a filestrings filestrings filestrings filestrings file
scan the whole file, not just loaded sectionsstrings -a filestrings -a filestrings -a filestrings -a file
set the minimum string lengthstrings -n number filestrings -n number filestrings -n number filestrings -n number file
show each string's offset in hexadecimalstrings -t x filestrings -t x filestrings -t x filestrings -t x file
show each string's offset in decimalstrings -t d file—strings -t d filestrings -t d file
search only a named ELF sectionstrings -N name file———

Standards

  • POSIX: strings is a POSIX.1-2024 utility.
  • Solnix: ATTRIBUTES: the strings utility, including all options except -N, is specified by standards (see standards(7)); -N is not currently specified by any standard. CSI is Enabled.

Writing portable scripts

  • Use only -a, -n number and -t d|o|x, which the Solnix, Linux, FreeBSD and OpenBSD pages all document. Write -t d or -t o instead of -o.
  • Do not rely on -f, -e, -N, long options or the default section scope. They are missing from Solnix or differ between systems.

Every difference here is taken from the manual pages linked above: Solnix's published page, Linux (man-pages and the GNU and util-linux manuals), FreeBSD, OpenBSD and NetBSD. Each row names its source. Where a manual is silent, this page is too. Compiled 2026-10-26. Found a mistake? Mail hackers@lists.solnix.io.