strings
命令在 Linux 中用于从一个二进制可执行文件或其他非文本文件中提取可打印的字符串。这对于检查程序中嵌入的版本信息、版权声明或其他文本信息非常有用。
要使用 strings
命令识别可执行文件,请按照以下步骤操作:
strings
命令,后跟上要检查的可执行文件的路径。例如:strings /path/to/your/executable-file
将 /path/to/your/executable-file
替换为实际可执行文件的路径。
strings
将输出可执行文件中的可打印字符串。如果你想查看特定数量的字符串,可以使用 -n
选项指定要显示的最小字符串长度。例如,要仅显示长度至少为 6 的字符串,请使用以下命令:
strings -n 6 /path/to/your/executable-file
此外,strings
命令还有许多其他选项,可以帮助你定制输出。要查看所有可用选项,请参阅 strings
的手册页(通过运行 man strings
命令)。