liuzhoou

如果不小心创建了".."目录的tar包文件,可以用pax命令来解决

  •  
  •   liuzhoou · Oct 7, 2012 · 3151 views
    This topic created in 4967 days ago, the information mentioned may be changed or developed.
    我碰到的问题:
    之前用 tar 备份了一个目录,今天解压时才发现压缩时把顶层目录搞成“..”了,因为系统不认为“..”是一个目录,所以解压就会出错;

    类似的UNIX的设计缺陷:
    输入 >-l 可以在目录下建立一个叫 "-l" 的文件一样;

    Google了半天发现pax:
    pax -- read and write file archives and copy directory hierarchies;

    最终把文件提取出来:
    pax -r -s "/\.\./newname/" -f name.tar


    不知道还又没又其他的方法?
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4049 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 05:06 · PVG 13:06 · LAX 22:06 · JFK 01:06
    ♥ Do have faith in what you're doing.