Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Title says it all. I'm on a unix machine, can't figure it out. Sublime Text 2 opens the PNG as Hex and TextMate as ASCII. I need binary. How can I do it?

share|improve this question

closed as not a real question by Gilles, jasonwryan, jw013, Mat, Caleb Nov 17 '12 at 12:42

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

5  
This makes very little sense. What exactly are you trying to do? –  Michael Mrozek Nov 16 '12 at 6:48
    
cat? (filler filler) –  Michael Kjörling Nov 16 '12 at 9:24
2  
And keep in mind that binary doens't make that much sense unless you're dealing with bitmaps (as in, black and white images). For that, you may be interested in converting to the ASCII variant of the Portable BitMap (pbm), which is, indeed, zeros and ones in ASCII. –  njsg Nov 16 '12 at 16:08

1 Answer 1

xxd(1) can do this:

$ cat test.txt
Test.
$ xxd -b test.txt
0000000: 01010100 01100101 01110011 01110100 00101110 00001010 Test..

From this forum post.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.