hexdump command examples in linux

hexdump:

linux1machine-~/ssdir: cat dumptext.txt
aj14Qy8

Character
linux1machine-~/ssdir: hexdump -c dumptext.txt
0000000   a   j   1   4   Q   y   8  \n
0000008



hex
linux1machine-~/ssdir: hexdump -x dumptext.txt
0000000    6a61    3431    7951    0a38
0000008

decimal
linux1machine-~/ssdir: hexdump -d dumptext.txt
0000000   27233   13361   31057   02616
0000008

octal
linux1machine-~/ssdir: hexdump -o dumptext.txt
0000000  065141  032061  074521  005070
0000008

octal byte by byte
linux1machine-~/ssdir: hexdump -b dumptext.txt
0000000 141 152 061 064 121 171 070 012
0000008

display number of fields
linux1machine-~/ssdir: hexdump -n 3 -x dumptext.txt
0000000    6a61    0031
0000003
linux1machine-~/ssdir: hexdump -n 3 -c dumptext.txt
0000000   a   j   1
0000003

skip number of bytes
linux1machine-~/ssdir: hexdump -s 2 -c dumptext.txt
0000002   1   4   Q   y   8  \n
0000008
linux1machine-~/ssdir: hexdump -s 2 -x dumptext.txt
0000002    3431    7951    0a38
0000008
linux1machine-~/ssdir:

linux1machine-~/ssdir: hexdump -C dumptext.txt
00000000  61 6a 31 34 51 79 38 0a                           |aj14Qy8.|
00000008

linux1machine-~/ssdir: cat dumptext2.txt
Hi hello how are you? This is agent2364.

linux1machine-~/ssdir: /usr/bin/hexdump -x dumptext2.txt
0000000    6948    6820    6c65    6f6c    6820    776f    6120    6572
0000010    7920    756f    203f    6854    7369    6920    2073    6761
0000020    6e65    3274    3633    2e34    000a
0000029






No comments:

Post a Comment