Linux命令--hexdump(以16进制查看文件内容)

原文网址:Linux命令--hexdump(以16进制查看文件内容)_IT利刃出鞘的博客-CSDN博客

简介

        本文介绍Linux的tac命令的用法。

        hexdump用于以16进制查看文件内容

格式

hexdump [-bcCdovx] [-e fmt] [-f fmt_file] [-n length] [-s skip] [file ...]

参数

-b     每个字节显示为8进制。一行共16个字节,一行开始以十六进制显示偏移值
-c     每个字节显示为ASCII字符
-C     每个字节显示为16进制和相应的ASCII字符
-d     两个字节显示为10进制
-e     格式化输出
-f     Specify a file that contains one or more newline separated format strings. Empty lines and lines whose first non-blank
        character is a hash mark (#) are ignored.
-n     只显示前n个长度的字符
-o     两个字节显示8进制数据
-s     从偏移量开始输出
-v     The -v option causes hexdump to display all input data. Without the -v option, any number of groups of output lines,
         which would be identical to the immediately preceding group of output lines
-x     双字节十六进制显示

示例

1.以ASCII字符显示文件中字符

    hexdump -c test

2.以16进制和相应的ASCII字符显示文件里的字符

    hexdump -C test

3.只显示文件中前n个字符

    hexdump -C -n 5 test

4.以偏移量开始格式输出

    hexdump -C -s 5 test

猜你喜欢

转载自blog.csdn.net/feiying0canglang/article/details/125569804
今日推荐