Conversions
De Linuxmemo.
(Différences entre les versions)
(→Binaire (b)) |
(→Hexadécimal (0x)) |
||
Ligne 14 : | Ligne 14 : | ||
==Hexadécimal (0x)== | ==Hexadécimal (0x)== | ||
- | *commande hexdump | + | *commande hexdump '''(fichier2hexa)''' |
dump un fichier au format hexadécimal | dump un fichier au format hexadécimal | ||
hexdump fichier.txt | hexdump fichier.txt | ||
Ligne 21 : | Ligne 21 : | ||
0000020 7473 7420 7365 2074 6574 7473 000a | 0000020 7473 7420 7365 2074 6574 7473 000a | ||
000002d | 000002d | ||
- | *commande xxd | + | *commande xxd '''(fichier2hexa)''' |
convertit en représentation hexadécimale | convertit en représentation hexadécimale | ||
xxd fichier.txt | xxd fichier.txt | ||
Ligne 28 : | Ligne 28 : | ||
0000020: 7374 2074 6573 7420 7465 7374 0a st test test. | 0000020: 7374 2074 6573 7420 7465 7374 0a st test test. | ||
- | *commande hexa vers binaire | + | *commande hexa vers binaire '''(hexa2binaire)''' |
echo '0006303030304e43' | xxd -r -p | echo '0006303030304e43' | xxd -r -p | ||
Version du 30 décembre 2014 à 20:39
Binaire (b)
- commande xxd (fichier2binaire)
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.
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
Octal (0)
- commande od
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