hexdump,hd,vi,这三个显示同一文件时字节内容各不相同?
左边是:hexdump test|less, 中键是:hd test |less ,右边是:vi test.
注:vi用的是:%!xxd命令
hexdump,hd,vi,这三个显示同一文件时字节内容各不相同?
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
-
- 帖子: 2284
- 注册时间: 2013-05-26 6:58
- 系统: Debian 9
- astolia
- 论坛版主
- 帖子: 6703
- 注册时间: 2008-09-18 13:11
Re: hexdump,hd,vi,这三个显示同一文件时字节内容各不相同?
一样的啊
代码: 全选
man hexdump
If no format strings are specified, the default display is equivalent to
specifying the -x option.
-x Two-byte hexadecimal display. Display the input offset in hexa‐
decimal, followed by eight, space separated, four column, zero-
filled, two-byte quantities of input data, in hexadecimal, per
line.
vi会保证文件以空行结尾,所以后面加了个换行-C Canonical hex+ASCII display. Display the input offset in hexa‐
decimal, followed by sixteen space-separated, two column, hexa‐
decimal bytes, followed by the same sixteen bytes in %_p format
enclosed in ``|'' characters.
Calling the command hd implies this option.
- astolia
- 论坛版主
- 帖子: 6703
- 注册时间: 2008-09-18 13:11
Re: hexdump,hd,vi,这三个显示同一文件时字节内容各不相同?
hexdump和hd的默认显示风格就等同于
od -t x2 和 od -t x1
这两个本来就是同一个东西
od -t x2 和 od -t x1
这两个本来就是同一个东西
代码: 全选
$ ls -l /usr/bin/hd
lrwxrwxrwx 1 root root 7 Jun 4 2013 /usr/bin/hd -> hexdump