V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
rookiemaster
V2EX  ›  程序员

关于 xxd 命令的输出

  •  
  •   rookiemaster · 11 天前 · 720 次点击

    使用 xxd a.out 或者 xxd a.png 都能在前面的几个字节看到这些文件的 magic number ,但是为什么 xxd a.txt 只能看到文本内容呢?

    5 条回复    2024-05-09 13:25:08 +08:00
    kkhaike
        1
    kkhaike  
       11 天前
    有没有一种可能。txt 就只有文本内容没有 magic number 呢
    seers
        2
    seers  
       11 天前 via iPhone
    因为一切文件都是字节,正是因为有了 magic number 才被识别成其他文件,不要本末倒置了
    rookiemaster
        3
    rookiemaster  
    OP
       11 天前 via iPhone
    @kkhaike 维基百科里有说 txt 文件存在 magic number
    chust
        4
    chust  
       11 天前
    @rookiemaster #3 你指的不会是 BOM 头吧?
    d4fg4
        5
    d4fg4  
       11 天前 via Android
    Bom 头已经基本淘汰了,现在的纯文本基本没有头部
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5115 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 06:42 · PVG 14:42 · LAX 23:42 · JFK 02:42
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.