Tag Info

New answers tagged

0

A perl solution: perl -ne 'use bytes; while ($a=substr $_,0,1,"") {printf "%08b\n", ord $a}' Remove the \n for everything in one long run-on print.


2

A pragmatic solution with xxd, cut and tr: xxd -b -c1 file | cut -d" " -f2 | tr -d "\n"


1

:help i_CTRL-V_digit In insert-mode, type control+V followed by a decimal number x then a hex number u then a 4-hexchar unicode sequence U then an 8-hexchar unicode sequence


1

If you want the binary output for a string of hex digits, xxd -r -p. E.g.: $ echo '0A0B0C0D' | xxd -r -p | xxd -b 0000000: 00001010 00001011 00001100 00001101 .... converts 0A0B0C0D into a four bytes of binary (first call to xxd), and then converts it back to be printable (second call). You say you want a binary output, but the ...



Top 50 recent answers are included