LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Display binary (not hex or od, actual ones and zeros) (https://www.linuxquestions.org/questions/linux-software-2/display-binary-not-hex-or-od-actual-ones-and-zeros-700063/)

leftty 01-26-2009 07:00 PM

Display binary (not hex or od, actual ones and zeros)
 
There's no functional purpose for this, but I would very much like to display binary files as they truly are - just ones and zeros. Does anyone know of a command line program which accomplishes this task?

pixellany 01-26-2009 07:55 PM

Well, the way the files "truly are" is one of two forms: stored charge (RAM), or magnetic fields (disk drive). So, you are going to need something like a sensitive voltmeter or magnetometer.........;)

Since demand is not high, I don't think any of the standard utilities have a binary option---thus you may need to write your own. Start with something like OD, and then set up a "case" construct to print out the binary code based on the octal output.

salasi 01-27-2009 04:56 AM

Well, if you were prepared to settle for the data and a GUI program to do it, you would have lots of alternatives.

magichabits 05-11-2011 01:15 AM

xxd -b to display ones and zeroes
 
xxd -b does this.

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

Gary Baker 05-12-2011 04:31 PM

Android app
 
Try Hex2bin android app if you want it for your phone.


All times are GMT -5. The time now is 08:31 PM.