在 Linux 下,strings 命令用于从二进制文件中提取可打印字符串。要把结果保存下来,常见方法如下:
strings file.bin > output.txt
>:覆盖写入 output.txt>>:追加写入 output.txt示例:
strings /bin/ls > ls_strings.txt
strings file.bin | tee output.txt
如果要以 追加 方式保存:
strings file.bin | tee -a output.txt
strings -n 6 file.bin > output.txt
-n 6:只显示长度 ≥ 6 的字符串strings file1 file2 file3 > all_strings.txt
或批量处理:
for f in *.bin; do
strings "$f" >> all_strings.txt
done
strings file.bin | grep "password" > passwords.txt
如果你是想:
可以告诉我具体场景,我可以给你更合适的命令。