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 default 4. three whole ways to say the same thing and honestly? iconic πŸ‘‘
  • -o β€” like -t o. some other versions of strings have -o act like -t d instead. 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 β€” o for octal, x for hexadecimal, or d for 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 characters
    • b = 16-bit bigendian
    • l = 16-bit littleendian
    • B = 32-bit bigendian
    • L = 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 (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 πŸ’…βœ¨