strings
命令在 Linux 中用于從二進制文件中提取可打印的字符串
打開終端。
輸入 strings
命令,后跟你想要提取字符串的文件路徑。例如:
strings /path/to/your/binary/file
這將輸出文件中所有可打印的字符串。
-t
選項指定輸出格式。例如,使用 -t x
以十六進制格式輸出字符串:strings -t x /path/to/your/binary/file
-n
選項。例如,僅輸出長度大于等于 4 的字符串:strings -n 4 /path/to/your/binary/file
strings file1.bin file2.bin file3.bin
>
或 >>
操作符。例如,將輸出保存到名為 output.txt
的文件中:strings /path/to/your/binary/file > output.txt
這將覆蓋 output.txt
文件中的現有內容。 若要將輸出追加到現有文件,請使用 >>
操作符:
strings /path/to/your/binary/file >> output.txt
通過組合這些選項,你可以根據需要定制 strings
命令的輸出。