zoukankan      html  css  js  c++  java
  • linux解压 tar命令

    linux解压 tar命令

    2010-01-23 09:17:16
     

    举例: 一,将整个/home/www/images 目录下的文件全部打包为 /home/www/images.tar

    [root@xoaocom ~]# tar -cvf /home/www/images.tar /home/www/images ← 仅打包,不压缩

    [root@xoaocom ~]# tar -zcvf /home/www/images.tar.gz /home/www/images ← 打包后,以gzip压缩

    解压到指定的目录

    [root@xoaocom ~]# tar -zxvf /home/images.tar.gz -C /specific dir

    一次使用tar报错的经历    

    root@www:/kuaizhao/usr/local/mysql/data# tar -cvfz /root/a.tar.gz /kuaizhao/usr/local/mysql/data/a
    tar: Removing leading `/' from member names
    tar: /root/a.tar.gz: Cannot stat: No such file or directory
    为什么会报错:tar: /root/a.tar.gz: Cannot stat: No such file or directory

    最后发现原因在于tar对option是有顺序要求的。一般把z放在前面

    tar -zcvf 就可以了。

  • 相关阅读:
    吴裕雄 Bootstrap 前端框架开发——Bootstrap 辅助类:强制元素显示
    吴裕雄 Bootstrap 前端框架开发——Bootstrap 辅助类:清除浮动
    吴裕雄 Bootstrap 前端框架开发——Bootstrap 辅助类:设置元素为 display:block 并居中显示
    吴裕雄 Bootstrap 前端框架开发——Bootstrap 辅助类:元素浮动到右边
    吴裕雄 Bootstrap 前端框架开发——Bootstrap 辅助类:元素浮动到左边
    吴裕雄 Bootstrap 前端框架开发——Bootstrap 辅助类:表格单元格使用了 "bg-danger" 类
    C语言常见命名规范
    Method and apparatus for establishing IEEE 1588 clock synchronization across a network element comprising first and second cooperating smart interface converters wrapping the network element
    MVC5 Controller构造方法获取User为空解决方法
    C#中AssemblyInfo.cs文件详解
  • 原文地址:https://www.cnblogs.com/youxin/p/3181172.html
Copyright © 2011-2022 走看看