STRINGS(1)

๐Ÿ“ฆ version 2.45, in ubuntu questing

๐ŸŽ€ NAME ๐ŸŽ€

okay bestie, this is STRINGS(1) from the GNU Development Tools crew ๐Ÿ’–

strings - print the sequences of printable characters in files โœจ

๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

strings [-afovV] [-min-len]
        [-n min-len] [--bytes=min-len]
        [-t radix] [--radix=radix]
        [-e encoding] [--encoding=encoding]
        [-U method] [--unicode=method]
        [-] [--all] [--print-file-name]
        [-T bfdname] [--target=bfdname]
        [-w] [--include-all-whitespace]
        [-s] [--output-separator sep_string]
        [--help] [--version] file...

๐ŸŒธ DESCRIPTION ๐ŸŒธ

okay so for each file you give it, GNU strings digs out the printable character sequences that are at least 4 characters long (or whatever number you pick with the options below) and that are followed by an unprintable character ๐Ÿ”

here's the tea ๐Ÿซ–: depending on how strings was configured, it either shows every printable sequence it can find in each file, or only the ones sitting in loadable, initialized data sections. if the file type is unrecognizable, or if strings is reading from stdin, it will always show all the printable sequences it can find. no cap ๐Ÿ’…

for backwards compatibility, any file that comes after a command-line option of just - also gets scanned in full, even if you used a -d option. iconic behaviour, honestly ๐Ÿ‘‘

strings is mainly useful for figuring out what's inside non-text files ๐Ÿงš

๐Ÿ’… OPTIONS ๐Ÿ’…

  • -a, --all, - โ€” scan the whole file, no matter what sections it has or whether those sections are loaded or initialized ๐ŸŒˆ this is usually the default, but strings can be configured so that -d is the default instead. ALSO the - option is position dependent: it forces full scans of any file mentioned after the - on the command line, even if -d was specified ๐Ÿ™ˆ
  • -d, --data โ€” only print strings from initialized, loaded data sections in the file โœจ this can cut down on the garbage in your output, BUT it also exposes the strings program to any security flaws lurking in the BFD library used to scan and load sections โš ๏ธ strings can be configured so this is the default. in that case, use -a to skip the BFD library and just print every string found in the file.
  • -f, --print-file-name โ€” print the name of the file before each string ๐Ÿ“
  • --help โ€” print a summary of program usage on the standard output and exit ๐Ÿซถ
  • -min-len, -n min-len, --bytes=min-len โ€” print sequences of displayable characters that are at least min-len characters long ๐Ÿ’– if you don't specify it, the default minimum length is 4. what counts as "displayable" depends on your -e and -U settings. sequences always end at control characters like newline and carriage-return, but NOT the tab character ๐Ÿ“
  • -o โ€” same as -t o ๐ŸŽ€ some other versions of strings make -o act like -t d instead. since we can't be compatible with both, this one picked -t o ๐Ÿ™ƒ
  • -t radix, --radix=radix โ€” print the offset within the file before each string ๐Ÿ”ข that single character picks the radix of the offset: o for octal, x for hexadecimal, or d for decimal ๐Ÿงฎ
  • -e encoding, --encoding=encoding โ€” choose the character encoding of the strings you're hunting for ๐Ÿ” the options are: s = single-7-bit-byte characters (the default), S = single-8-bit-byte characters, b = 16-bit bigendian, l = 16-bit littleendian, B = 32-bit bigendian, and L = 32-bit littleendian. super useful for finding wide character strings! (l and b apply to things like Unicode UTF-16/UCS-2 encodings ๐ŸŒ)
  • -U [d|i|l|e|x|h], --unicode=[default|invalid|locale|escape|hex|highlight] โ€” controls how UTF-8 encoded multibyte characters show up in your strings ๐ŸŒธ the default (--unicode=default) gives them no special treatment and relies on whatever --encoding says. every other value automatically turns on --encoding=S.
    • --unicode=invalid treats them as non-graphic characters, so they're NOT part of a valid string ๐Ÿšซ
    • --unicode=locale shows them in the current locale, which may or may not support UTF-8 encoding ๐Ÿ—บ๏ธ
    • --unicode=hex shows them as hex byte sequences wrapped in <> characters ๐Ÿงฉ
    • --unicode=escape shows them as escape sequences (\uxxxx) ๐Ÿช„
    • --unicode=highlight shows the escape sequences highlighted in red (if your output device supports it) ๐Ÿšจ the colouring is there to draw your eye to unicode sequences where they might not be expected ๐Ÿ‘€

all the options except invalid treat them as valid string characters, btw โœจ

  • -T bfdname, --target=bfdname โ€” specify an object code format other than your system's default format ๐ŸŽฏ
  • -v, -V, --version โ€” print the program version number on the standard output and exit ๐Ÿ”–
  • -w, --include-all-whitespace โ€” by default, tab and space characters are included in the strings that get displayed, but other whitespace like newlines and carriage returns are NOT ๐Ÿ™… -w changes that so ALL whitespace characters count as part of a string ๐Ÿซง
  • -s, --output-separator โ€” by default, output strings are delimited by a new-line ๐Ÿ’… this option lets you supply any string to use as the output record separator. it's especially handy with --include-all-whitespace, since strings might contain new-lines inside them ๐Ÿง
  • @file โ€” read command-line options from file ๐Ÿ“œ the options read get inserted right where the original @file option was. if file doesn't exist or can't be read, the option gets treated literally and is NOT removed ๐Ÿ˜ค
    • options inside file are separated by whitespace ๐Ÿซง
    • to include a whitespace character in an option, wrap the whole option in either single or double quotes ๐ŸŽ€
    • to include any character (including a backslash), prefix it with a backslash ๐Ÿชถ
    • the file can contain its own @file options too, and those get processed recursively ๐ŸŒ€

๐Ÿ”— SEE ALSO ๐Ÿ”—

ar(1), nm(1), objdump(1), ranlib(1), readelf(1) and the Info entries for binutils ๐Ÿ“š

Copyright (c) 1991-2025 Free Software Foundation, Inc. ๐Ÿ’œ

permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. a copy of the license is included in the section entitled "GNU Free Documentation License" ๐Ÿ“œ


and that's the whole vibe, bestie ๐Ÿซถ this page came from binutils-2.45, dated 2025-12-03, and it is STRINGS(1) all the way through ๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from