Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 linux,我有两个二进制文件 - TRA 和 TRF。TRA 应包含在 TRF 中。我怎样才能确认这一点?
我试过了grep -vf TRA TRF
grep -vf TRA TRF
但它总是说它匹配,即使我确定它不匹配。
您可以将二进制数据转换为文本,然后对其进行 grep:
od -A n -v -t x1 TRA | tr -d '\n' > TRA_HEX od -A n -v -t x1 TRF | tr -d '\n' > TRF_HEX if grep -f TRA_HEX TRF_HEX > /dev/null; then echo "included" fi