strings
命令用于从二进制文件中提取可打印的字符串
strings 'file_with_special_chars.bin'
或
strings "file_with_special_chars.bin"
strings file_with_special_chars\.bin
strings
命令的输入,可以使用命令替换。例如:strings "$(command_that_outputs_filename)"
xargs
命令将这些文件名传递给 strings
命令。例如:echo "file_with_special_chars1.bin
file_with_special_chars2.bin" | xargs strings
总之,处理特殊字符的关键是确保shell不会对它们进行解释。使用引号、转义字符或命令替换等方法可以避免特殊字符被错误地解释。