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?
If you want to open binary files (in CentOS 7):
strings <binary_filename>
sudo apt-get install bless
Bless is GUI tool which can view, edit, seach and a lot more. Its very light weight.
You can use hexdump binary file
sudo apt-get install hexdump
hexdump -C yourfile.bin
$ echo -n 'Hello world!' | hd
00000000 48 65 6c 6c 6f 20 77 6f 72 6c 64 21 |Hello world!|
0000000c
vi your_filename
hit esc
Type :%!xxd
to view the hex strings, the n :%!xxd -r
to return to normal editing.
xxd does both binary and hexadecimal.
bin:
xxd -b file
hex:
xxd file