Conversions

De Linuxmemo.

[modifier] Binaire (b)

  • commande xxd (fichier2RepresentationBinaire)

dump binaire

xxd -b fichier.txt 
0000000: 01110100 01100101 01110011 01110100 00100000 01110100  test t
0000006: 01100101 01110011 01110100 00100000 01110100 01100101  est te
000000c: 01110011 01110100 00001010 01110100 01100101 01110011  st.tes
0000012: 01110100 00100000 01110100 01100101 01110011 01110100  t test
0000018: 00100000 01110100 01100101 01110011 01110100 00001010   test.
000001e: 01110100 01100101 01110011 01110100 00100000 01110100  test t
0000024: 01100101 01110011 01110100 00100000 01110100 01100101  est te
000002a: 01110011 01110100 00001010                             st.
  • commande xxd (hexa2RepresentationBinaire)
echo '0006303030304e43' | xxd -b
0000000: 00110000 00110000 00110000 00110110 00110011 00110000  000630
0000006: 00110011 00110000 00110011 00110000 00110011 00110000  303030
000000c: 00110100 01100101 00110100 00110011 00001010           4e43.

[modifier] Hexadécimal (0x)

  • commande hexdump (fichier2hexa)

dump un fichier au format hexadécimal

hexdump fichier.txt
0000000 6574 7473 7420 7365 2074 6574 7473 740a
0000010 7365 2074 6574 7473 7420 7365 0a74 6574
0000020 7473 7420 7365 2074 6574 7473 000a     
000002d
  • commande xxd (fichier2hexa)

convertit en représentation hexadécimale

xxd fichier.txt 
0000000: 7465 7374 2074 6573 7420 7465 7374 0a74  test test test.t
0000010: 6573 7420 7465 7374 2074 6573 740a 7465  est test test.te
0000020: 7374 2074 6573 7420 7465 7374 0a         st test test.
  • commande hexa vers binaire (hexa2binaire)
echo '0006303030304e43' | xxd -r -p

[modifier] Octal (0)

  • commande od (fichier2octal)

dump un fichier au format octal

od fichier.txt 
0000000 062564 072163 072040 071545 020164 062564 072163 072012
0000020 071545 020164 062564 072163 072040 071545 005164 062564
0000040 072163 072040 071545 020164 062564 072163 000012
0000055
Outils personnels