Search code examples
bashshellbinary

How to view files in binary from bash?


I would like to view the contents of a file in the current directory, but in binary from the command line. How can I achieve this?


Solution

  • xxd does both binary and hexadecimal.

    bin:

    xxd -b file
    

    hex:

    xxd file