strings
命令在 Linux 中用于从二进制文件中提取可打印的字符串。以下是一些常用的 strings
参数:
-n <min-len>
: 只输出长度至少为 <min-len>
的字符串。-t <radix>
: 用指定的进制显示数字,例如十六进制(x
)、八进制(o
)或十进制(d
)。默认是十六进制。-e <encoding>
: 指定字符编码,如 ascii
、ibm866
、utf8
等。默认是 ascii
。-
: 用于指定多个文件或目录。-o <offset>
: 从指定的偏移量开始搜索字符串。-T <type>
: 指定输出类型,如 ascii
、ucs2le
、ucs2be
、utf8
等。默认是 ascii
。-w
: 宽字符模式,用于处理宽字符集。-V
: 显示版本信息。这些参数可以帮助您更精确地控制 strings
命令的输出。要查看所有可用参数,请参阅 strings
命令的手册页(通过运行 man strings
)。