.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "STRINGS 1" .TH STRINGS 1 2024-06-05 binutils-2.42 "GNU Development Tools" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME strings \- print the sequences of printable characters in files .SH SYNOPSIS .IX Header "SYNOPSIS" strings [\fB\-afovV\fR] [\fB\-\fR\fImin-len\fR] [\fB\-n\fR \fImin-len\fR] [\fB\-\-bytes=\fR\fImin-len\fR] [\fB\-t\fR \fIradix\fR] [\fB\-\-radix=\fR\fIradix\fR] [\fB\-e\fR \fIencoding\fR] [\fB\-\-encoding=\fR\fIencoding\fR] [\fB\-U\fR \fImethod\fR] [\fB\-\-unicode=\fR\fImethod\fR] [\fB\-\fR] [\fB\-\-all\fR] [\fB\-\-print\-file\-name\fR] [\fB\-T\fR \fIbfdname\fR] [\fB\-\-target=\fR\fIbfdname\fR] [\fB\-w\fR] [\fB\-\-include\-all\-whitespace\fR] [\fB\-s\fR] [\fB\-\-output\-separator\fR \fIsep_string\fR] [\fB\-\-help\fR] [\fB\-\-version\fR] \fIfile\fR... .SH DESCRIPTION .IX Header "DESCRIPTION" For each \fIfile\fR given, GNU \fBstrings\fR prints the printable character sequences that are at least 4 characters long (or the number given with the options below) and are followed by an unprintable character. .PP Depending upon how the strings program was configured it will default to either displaying all the printable sequences that it can find in each file, or only those sequences that are in loadable, initialized data sections. If the file type is unrecognizable, or if strings is reading from stdin then it will always display all of the printable sequences that it can find. .PP For backwards compatibility any file that occurs after a command-line option of just \fB\-\fR will also be scanned in full, regardless of the presence of any \fB\-d\fR option. .PP \&\fBstrings\fR is mainly useful for determining the contents of non-text files. .SH OPTIONS .IX Header "OPTIONS" .IP \fB\-a\fR 4 .IX Item "-a" .PD 0 .IP \fB\-\-all\fR 4 .IX Item "--all" .IP \fB\-\fR 4 .IX Item "-" .PD Scan the whole file, regardless of what sections it contains or whether those sections are loaded or initialized. Normally this is the default behaviour, but strings can be configured so that the \&\fB\-d\fR is the default instead. .Sp The \fB\-\fR option is position dependent and forces strings to perform full scans of any file that is mentioned after the \fB\-\fR on the command line, even if the \fB\-d\fR option has been specified. .IP \fB\-d\fR 4 .IX Item "-d" .PD 0 .IP \fB\-\-data\fR 4 .IX Item "--data" .PD Only print strings from initialized, loaded data sections in the file. This may reduce the amount of garbage in the output, but it also exposes the strings program to any security flaws that may be present in the BFD library used to scan and load sections. Strings can be configured so that this option is the default behaviour. In such cases the \fB\-a\fR option can be used to avoid using the BFD library and instead just print all of the strings found in the file. .IP \fB\-f\fR 4 .IX Item "-f" .PD 0 .IP \fB\-\-print\-file\-name\fR 4 .IX Item "--print-file-name" .PD Print the name of the file before each string. .IP \fB\-\-help\fR 4 .IX Item "--help" Print a summary of the program usage on the standard output and exit. .IP \fB\-\fR\fImin-len\fR 4 .IX Item "-min-len" .PD 0 .IP "\fB\-n\fR \fImin-len\fR" 4 .IX Item "-n min-len" .IP \fB\-\-bytes=\fR\fImin-len\fR 4 .IX Item "--bytes=min-len" .PD Print sequences of displayable characters that are at least \&\fImin-len\fR characters long. If not specified a default minimum length of 4 is used. The distinction between displayable and non-displayable characters depends upon the setting of the \&\fB\-e\fR and \fB\-U\fR options. Sequences are always terminated at control characters such as new-line and carriage-return, but not the tab character. .IP \fB\-o\fR 4 .IX Item "-o" Like \fB\-t o\fR. Some other versions of \fBstrings\fR have \fB\-o\fR act like \fB\-t d\fR instead. Since we can not be compatible with both ways, we simply chose one. .IP "\fB\-t\fR \fIradix\fR" 4 .IX Item "-t radix" .PD 0 .IP \fB\-\-radix=\fR\fIradix\fR 4 .IX Item "--radix=radix" .PD Print the offset within the file before each string. The single character argument specifies the radix of the offset\-\-\-\fBo\fR for octal, \fBx\fR for hexadecimal, or \fBd\fR for decimal. .IP "\fB\-e\fR \fIencoding\fR" 4 .IX Item "-e encoding" .PD 0 .IP \fB\-\-encoding=\fR\fIencoding\fR 4 .IX Item "--encoding=encoding" .PD Select the character encoding of the strings that are to be found. Possible values for \fIencoding\fR are: \fBs\fR = single\-7\-bit\-byte characters (default), \fBS\fR = single\-8\-bit\-byte characters, \fBb\fR = 16\-bit bigendian, \fBl\fR = 16\-bit littleendian, \fBB\fR = 32\-bit bigendian, \fBL\fR = 32\-bit littleendian. Useful for finding wide character strings. (\fBl\fR and \fBb\fR apply to, for example, Unicode UTF\-16/UCS\-2 encodings). .IP "\fB\-U\fR \fI[d|i|l|e|x|h]\fR" 4 .IX Item "-U [d|i|l|e|x|h]" .PD 0 .IP \fB\-\-unicode=\fR\fI[default|invalid|locale|escape|hex|highlight]\fR 4 .IX Item "--unicode=[default|invalid|locale|escape|hex|highlight]" .PD Controls the display of UTF\-8 encoded multibyte characters in strings. The default (\fB\-\-unicode=default\fR) is to give them no special treatment, and instead rely upon the setting of the \&\fB\-\-encoding\fR option. The other values for this option automatically enable \fB\-\-encoding=S\fR. .Sp The \fB\-\-unicode=invalid\fR option treats them as non-graphic characters and hence not part of a valid string. All the remaining options treat them as valid string characters. .Sp The \fB\-\-unicode=locale\fR option displays them in the current locale, which may or may not support UTF\-8 encoding. The \&\fB\-\-unicode=hex\fR option displays them as hex byte sequences enclosed between \fI<>\fR characters. The \fB\-\-unicode=escape\fR option displays them as escape sequences (\fI\euxxxx\fR) and the \&\fB\-\-unicode=highlight\fR option displays them as escape sequences highlighted in red (if supported by the output device). The colouring is intended to draw attention to the presence of unicode sequences where they might not be expected. .IP "\fB\-T\fR \fIbfdname\fR" 4 .IX Item "-T bfdname" .PD 0 .IP \fB\-\-target=\fR\fIbfdname\fR 4 .IX Item "--target=bfdname" .PD Specify an object code format other than your system's default format. .IP \fB\-v\fR 4 .IX Item "-v" .PD 0 .IP \fB\-V\fR 4 .IX Item "-V" .IP \fB\-\-version\fR 4 .IX Item "--version" .PD Print the program version number on the standard output and exit. .IP \fB\-w\fR 4 .IX Item "-w" .PD 0 .IP \fB\-\-include\-all\-whitespace\fR 4 .IX Item "--include-all-whitespace" .PD By default tab and space characters are included in the strings that are displayed, but other whitespace characters, such a newlines and carriage returns, are not. The \fB\-w\fR option changes this so that all whitespace characters are considered to be part of a string. .IP \fB\-s\fR 4 .IX Item "-s" .PD 0 .IP \fB\-\-output\-separator\fR 4 .IX Item "--output-separator" .PD By default, output strings are delimited by a new-line. This option allows you to supply any string to be used as the output record separator. Useful with \-\-include\-all\-whitespace where strings may contain new-lines internally. .IP \fB@\fR\fIfile\fR 4 .IX Item "@file" Read command-line options from \fIfile\fR. The options read are inserted in place of the original @\fIfile\fR option. If \fIfile\fR does not exist, or cannot be read, then the option will be treated literally, and not removed. .Sp Options in \fIfile\fR are separated by whitespace. A whitespace character may be included in an option by surrounding the entire option in either single or double quotes. Any character (including a backslash) may be included by prefixing the character to be included with a backslash. The \fIfile\fR may itself contain additional @\fIfile\fR options; any such options will be processed recursively. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBar\fR\|(1), \fBnm\fR\|(1), \fBobjdump\fR\|(1), \fBranlib\fR\|(1), \fBreadelf\fR\|(1) and the Info entries for \fIbinutils\fR. .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (c) 1991\-2024 Free Software Foundation, Inc. .PP 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".