How to view a binary file

assemblybinary

From what I understand, a compiler makes a binary file that consists of 1's and 0's that a CPU can read. I have a binary file but how do I open it to see the 1's and 0's that are there? A text editor says it can't open it…

P.S. I have an assembly compiled binary that should be plain binary code of 1's and 0's?

Best Answer

According to this answer by tyranid:

hexdump -C yourfile.bin 

unless you want to edit it of course. Most Linux distros have hexdump by default (but obviously not all).


Update

According to this answer by Emilio Bool:

xxd does both binary and hexadecimal

For bin :

xxd -b file

For hex :

xxd file
Related Question