在 Linux 中,strings 命令用于从二进制文件或数据中抽取可打印字符串。如果你想保存 strings 的输出,常见做法有以下几种:
strings file.bin > output.txt
>:覆盖写入>>:追加写入示例:
strings /bin/ls > ls_strings.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 file.bin | grep -i "password" > passwords.txt
strings file.bin | sed 's/"/""/g' | awk '{print "\""$0"\""}' > output.csv
LC_ALL=C strings file.bin > output.txt
或:
strings -e l file.bin > output.txt
-e l:16-bit little-endiannohup strings bigfile.bin > output.txt 2>&1 &
如果你能说明:
我可以给你更精确的保存方案。