Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The only thing the -U does is to not strip carriage returns embedded in the file.

But if you do, for example, grep NSA_KEY suspiciousfile.exe, you're either going to get:

(a) "Binary file suspiciousfile.exe matches" (which is what I get on the particular system I tried it on, and I'd call that semi-useful because I'd like to see some context around it)

or possibly,

(b) a 50,000-character gibberish output to your shell containing somewhere within it the string "NSA_KEY" if you can possibly scroll through it to see where it appeared.

I think strings, or this bingrep, or some other binary-aware strings-like tool is better.



Unless you use -o/--only-matching, that works fine for binaries!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: