STRINGS(1)
๐ 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, butstringscan be configured so that-dis 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-dwas 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 thestringsprogram to any security flaws lurking in the BFD library used to scan and load sections โ ๏ธstringscan be configured so this is the default. in that case, use-ato 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 leastmin-lencharacters long ๐ if you don't specify it, the default minimum length is 4. what counts as "displayable" depends on your-eand-Usettings. sequences always end at control characters like newline and carriage-return, but NOT the tab character ๐-oโ same as-t o๐ some other versions ofstringsmake-oact like-t dinstead. 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:ofor octal,xfor hexadecimal, ordfor 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, andL= 32-bit littleendian. super useful for finding wide character strings! (landbapply 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--encodingsays. every other value automatically turns on--encoding=S.--unicode=invalidtreats them as non-graphic characters, so they're NOT part of a valid string ๐ซ--unicode=localeshows them in the current locale, which may or may not support UTF-8 encoding ๐บ๏ธ--unicode=hexshows them as hex byte sequences wrapped in<>characters ๐งฉ--unicode=escapeshows them as escape sequences (\uxxxx) ๐ช--unicode=highlightshows 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 ๐-wchanges 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 fromfile๐ the options read get inserted right where the original@fileoption was. iffiledoesn't exist or can't be read, the option gets treated literally and is NOT removed ๐ค- options inside
fileare 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
@fileoptions too, and those get processed recursively ๐
- options inside
๐ SEE ALSO ๐
ar(1), nm(1), objdump(1), ranlib(1), readelf(1) and the Info entries for binutils ๐
โญ COPYRIGHT โญ
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
- ubuntu questing: binutils-common 2.45-7ubuntu1.2
- ubuntu questing: binutils-x86-64-linux-gnu 2.45-7ubuntu1.2
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms