← 返回命令列表

Linux command

strings 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Find printable strings

strings [file]

Find strings

strings -n [10] [file]

Print filename

strings -f [file1] [file2]

Print offset

strings -t d [file]

Print offset in hexadecimal

strings -t x [file]

Search entire file

strings -a [file]

Search for specific encoding

strings -e l [file]

Scan multiple files

strings [*.bin]

说明

strings finds and prints sequences of printable characters in files, typically binary files. By default, it looks for sequences of at least 4 printable characters followed by an unprintable character. The tool is commonly used to examine binaries, extract text from executables, find embedded messages, and perform basic forensic analysis. It can reveal version strings, error messages, and other embedded text. strings ignores the structure of the file and simply scans for character sequences, making it useful when file format isn't known or important.

参数

-a, --all
Scan entire file, not just data sections.
-f, --print-file-name
Print filename before each string.
-n _min_, --bytes= _min_
Minimum string length (default 4).
-t _format_, --radix= _format_
Print offset (o=octal, d=decimal, x=hex).
-e _encoding_
Character encoding (s=7-bit, S=8-bit, b/l=16-bit, B/L=32-bit).
-o
Print offset in octal (like -t o).
-T _bfdname_, --target= _bfdname_
Specify binary format.

FAQ

What is the strings command used for?

strings finds and prints sequences of printable characters in files, typically binary files. By default, it looks for sequences of at least 4 printable characters followed by an unprintable character. The tool is commonly used to examine binaries, extract text from executables, find embedded messages, and perform basic forensic analysis. It can reveal version strings, error messages, and other embedded text. strings ignores the structure of the file and simply scans for character sequences, making it useful when file format isn't known or important.

How do I run a basic strings example?

Run `strings [file]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -a, --all do in strings?

Scan entire file, not just data sections.