strings
命令在 Linux 中用于从二进制文件中提取可打印的字符串
打开终端。
输入 strings
命令,后跟你想要提取字符串的文件路径。例如:
strings /path/to/your/binary/file
这将输出文件中所有可打印的字符串。
-t
选项指定输出格式。例如,使用 -t x
以十六进制格式输出字符串:strings -t x /path/to/your/binary/file
-n
选项。例如,仅输出长度大于等于 4 的字符串:strings -n 4 /path/to/your/binary/file
strings file1.bin file2.bin file3.bin
>
或 >>
操作符。例如,将输出保存到名为 output.txt
的文件中:strings /path/to/your/binary/file > output.txt
这将覆盖 output.txt
文件中的现有内容。 若要将输出追加到现有文件,请使用 >>
操作符:
strings /path/to/your/binary/file >> output.txt
通过组合这些选项,你可以根据需要定制 strings
命令的输出。