STRINGS(1)
π STRINGS(1) π
okay bestie, so this is strings, a GNU Development Tools classic, and it's literally the moment your non-text files stop gatekeeping their secrets β¨
πΈ NAME πΈ
strings β print the strings of printable characters in files.
yes. that's it. that's the whole job. and it ate π
π SYNOPSIS π
strings [-afov] [-min-len]
[-n min-len] [--bytes=min-len]
[-t radix] [--radix=radix]
[-e encoding] [--encoding=encoding]
[-] [--all] [--print-file-name]
[--target=bfdname]
[--help] [--version] file...
π¦ DESCRIPTION π¦
so for every single file you hand it, GNU strings prints the printable character sequences that are at least 4 characters long (or however many you asked for with the options below, no judgement) and that are followed by an unprintable character. that's the vibe check: printable run, then a little non-printable gremlin right after it π«Ά
by default? it only prints the strings from the initialized and loaded sections of object files. for other types of files, it prints the strings from the whole file. lowkey different rules for different file types, iykyk.
and like β strings is mainly useful for determining the contents of non-text files. that's its whole main character arc π
β¨ OPTIONS β¨
-a,--allβ do not scan only the initialized and loaded sections of object files; scan the whole files. all of it. no section left behind π₯-f,--print-file-nameβ print the name of the file before each string, so you know which file is doing all the talking π--helpβ print a summary of the program usage on the standard output and exit. your little cheat sheet π§-min-len,-n min-len,--bytes=min-lenβ print sequences of characters that are at least min-len characters long, instead of the default4. three whole ways to say the same thing and honestly? iconic π-oβ like-t o. some other versions ofstringshave-oact like-t dinstead. since we can not be compatible with both ways, we simply chose one. no cap, this is a real conflict and we picked a side π-t radix,--radix=radixβ print the offset within the file before each string. the single character argument specifies the radix of the offset βofor octal,xfor hexadecimal, ordfor decimal. pick your flavour π-e encoding,--encoding=encodingβ select the character encoding of the strings that are to be found. possible values for encoding are:s= single-7-bit-byte characters (ASCII, ISO 8859, etc., default)S= single-8-bit-byte charactersb= 16-bit bigendianl= 16-bit littleendianB= 32-bit bigendianL= 32-bit littleendian
useful for finding wide character strings. wide strings said let me speak π
--target=bfdnameβ specify an object code format other than your system's default format. be the exception, bestie β¨-v,--versionβ print the program version number on the standard output and exit. the little "hi, here's who I am" moment π
π SEE ALSO π
ar(1), nm(1), objdump(1), ranlib(1), readelf(1) and the Info entries for binutils.
the whole friend group fr fr π«Ά
π COPYRIGHT π
Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 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.1 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''.
π okay and for the sign-off: this whole page is from binutils-2.15.97, dated 2005-04-20 β so it's vintage, it's retro, it's literally older than most of us and still serving. stan a legacy tool that never misses π β¨
π¦ where this page comes from
- debian bookworm: binutils-h8300-hms 2.16.1-10+b2
- debian trixie: binutils-h8300-hms 2.16.1-13
- ubuntu jammy: binutils-h8300-hms 2.16.1-10build1
- ubuntu noble: binutils-h8300-hms 2.16.1-10build1
- ubuntu resolute: binutils-h8300-hms 2.16.1-15
- ubuntu stonking: binutils-h8300-hms 2.16.1-15
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms