zoukankan      html  css  js  c++  java
  • linux命令-tar工具详解

    把文件和目录打成一个包 

     文件打包

    [root@wangshaojun ~]# tar -cvf 1.tar 1.txt 123 234 ///-c创建 -v可视化 -f file放最后面
    1.txt
    123/
    123/111/
    123/111/234/
    123/111/234/22.txt
    234/
    234/123.txt

    //////////////////////////////////////////////////////////

    查看tar包的内容

    [root@wangshaojun ~]# tar -tf 1.tar
    111.txt.xz
    123/
    123/999/
    123/999/888.txt
    123/111/
    123/111/234/
    123/111/234/22.txt
    222/

    ///////////////////////////////////////////////////////////

    解包

    [root@wangshaojun ~]# tar -xvf 1.tar
    1.txt
    123/
    123/111/
    123/111/234/
    123/111/234/22.txt
    234/
    234/123.txt
    [root@wangshaojun ~]# ls

    不提醒是否覆盖 1.tar不消失

    /////////////////////////////////////////////////////////////////

    指定目录解包

    [root@wangshaojun ~]# tar -C /tmp/ -xvf 1.tar

    1.txt
    123/
    123/111/
    123/111/234/
    123/111/234/22.txt
    234/
    234/123.txt
    [root@wangshaojun ~]# ls /tmp/
    111 1.txt
    111.txt 222 233.txt 
    123  234 

  • 相关阅读:
    转 vue动画总结
    html常用字体
    GIT常用命令
    h5 编辑单选框的样式
    转载 配置vue项目
    npm audit fix 报错
    mysql驱动包
    vue仿移动端输入框
    vue过渡动画样式
    解读Scrapy框架
  • 原文地址:https://www.cnblogs.com/wangshaojun/p/4957718.html
Copyright © 2011-2022 走看看