linux 显示 16 进制内容 - xxd

· Frytea · 5 分钟 · 技术笔记
linux 显示 16 进制内容 - xxd

命令用法

$ xxd [options] [infile [outfile]]

其中,

  • infile 表示要输入进行 16 进制编码的文件
  • outfile 表示转换结果的输出文件

使用实例

显示十六进制格式
gackle@machine:\x7e$ echo 1111111 > 1.txt

gackle@machine:~$ cat 1.txt
1111111

gackle@machine:~$ xxd 1.txt
00000000: 3131 3131 3131 310a                      1111111.

转换为二进制形式显示
gackle@machine:~$ xxd 1.txt |xxd -r
1111111

References