# hexdump -h
hexdump: invalid option -- 'h' Usage:
hexdump [options] file... Options:
-b one-byte octal display#单字节八进制显示
-c one-byte character display#单字节字符显示
-C canonical hex+ASCII display#规范化 十六进制+ASCII 显示
-d two-byte decimal display#两字节十进制显示
-o two-byte octal display#两字节八进制显示
-x two-byte hexadecimal display#两字节十六进制显示
-e format format string to be used for displaying data#格式 用于显示数据的格式字符串
-f format_file file that contains format strings#格式文件 包含格式字符串的文件
-n length interpret only length bytes of input#长度 只解释输入的指定长度个字节
-s offset skip offset bytes from the beginning#偏移 跳过开头指定长度个字节
-v display without squeezing similar lines#显示时不压缩相似的行
-V output version information and exit#显示此帮助并退出

  

# more a.txt
abcde
ABCDE
# hexdump a.txt
0000000 6261 6463 0a65 4241 4443 0a45
000000c

  

第一列表示:文件偏移量
第二列表示:以两个字节为一组的十六进制
上面的输出结果翻译一下,就是:

badc0aeBADC0aE

(注意:在Linux中换行符\n 的十六进制为0a,在windows中,换行为\r\n的十六进制编码为:0d 0a)

为什么翻译成文本成倒序了呢?

其实这是CPU架构所致,感兴趣的可以看下大小端的定义:
1) Little-Endian就是低位字节排放在内存的低地址端,高位字节排放在内存的高地址端。(X86 CPU系列采用的位序)
2) Big-Endian就是高位字节排放在内存的低地址端,低位字节排放在内存的高地址端。
3) 网络字节序:TCP/IP各层协议将字节序定义为Big-Endian,因此TCP/IP协议中使用的字节序通常称之为网络字节序。

有没有更加较便于方便的查看方式了?有,这也是较常用的方式。
以16进制和相应的ASCII字符显示文件里的字符:

# hexdump -C a.txt
00000000 61 62 63 64 65 0a 41 42 43 44 45 0a |abcde.ABCDE.|
0000000c

  

最新文章

  1. SVN源码泄露漏洞
  2. ACM 笨小熊
  3. Yii路径总结
  4. 关于停止AsyncTask和Thread的问题
  5. Shell good example
  6. hiho一下 第九十八周 搜索一·24点
  7. uvalive 4255 Guess(拓扑排序)
  8. SharedPreference.Editor的apply与commit方法不同之处
  9. JavaSE(十)集合之List
  10. MQTT——入门介绍
  11. 获得只有 [年 月 日] 的Date 对象
  12. PyCharm 2018.1破解过程
  13. Python两大佬互相撕逼 技术何苦为难技术?
  14. django(channel)到 ubuntu
  15. 【第二组】Hunter——beta版发布文档
  16. zabbix3.4.7页面中文乱码
  17. hyperledger
  18. js 操作数字类型
  19. Flask租房项目总结
  20. 介绍nodejs中的path模块的几个方法

热门文章

  1. SpringBoot + sqlserver+mybatis
  2. ssm的maven项目启动tomcat时报错,Cannot find class: XXXX解决办法
  3. NAT实验
  4. Linux操作系统的计划任务
  5. admin端的教师管理功能测试
  6. danci1
  7. K-means:如何选择K(cluster的数目)
  8. CentOS6.5配置
  9. python无法导入自己的模块的解决办法
  10. 基于思岚A1激光雷达+OpenGL+VS2017的Ramer-Douglas-Peucker算法的实现