在 Debian 系统里看到 “strings 报错”,通常和 binutils 没装 / 版本不兼容 / 文件问题 有关。下面按常见情况逐一说明怎么解决。
strings: command not found系统没有安装 strings 命令(它属于 binutils)。
sudo apt update
sudo apt install binutils
安装后检查:
which strings
strings --version
strings 执行时报错(不是找不到命令)strings: file format not recognizedstrings: test.bin: file format not recognized
file 看文件类型:file test.bin
unzip / tar -xvf
strings -a test.bin
strings: Invalid argument常见于:
cp test.bin /tmp/
cd /tmp
strings test.bin
strings: out of memory大文件时容易遇到。
限制输出:
strings -n 6 bigfile | head -n 1000
老版本 binutils 有 bug。
apt install binutils
cat file | grep -a
或:
strings替代品:
apt install elfutils
readelf -p .rodata file
如果你能贴出 完整的报错信息,例如:
strings: xxx: xxxx
我可以给你精确解决方案,不用猜。