在 Linux 中,strings 命令用于从二进制文件中提取可打印字符串。如果你想把 strings 的输出保存下来,通常有以下几种方式:
strings file.bin > output.txt
> 表示覆盖写入 output.txt追加写入:
strings file.bin >> output.txt
strings file.bin | tee output.txt
output.txt追加:
strings file.bin | tee -a output.txt
strings -n 6 file.bin | nl > output.txt
-n 6:只显示长度 ≥ 6 的字符串nl:加行号strings *.bin > all_strings.txt
例如只提取包含 “password” 的字符串:
strings file.bin | grep password > result.txt
strings -a -t x file.bin > output.txt
-t x:显示十六进制偏移-a:扫描整个文件如果你有具体场景(比如想保存哪类字符串、是否要过滤、是否要批量处理),可以告诉我,我可以给你更精确的命令。