zoukankan      html  css  js  c++  java
  • Linux ->> Linux下压缩和解压缩命令targzipzip

    tar命令解压tar、 gz、bz2结尾的压缩包,-C 目标文件夹,-f 文件名,区别是bz2是 tar -j 而gz是-z

    tar -zxvf VMwareTools-10.0.5-3228253.tar.gz -C /home/VMTools
    tar -jxvf VMwareTools-10.0.5-3228253.tar.bz2 -C /home/VMTools
    tar -zcvf gz_test.tar.gz ./test.txt ./test2.txt

    上面是打包多个文件

    下面是打包整个目录

    tar -zcvf gz_test.tar.gz ./*

    tar命令压缩打包文件到压缩包,打包test.txt和cmd两个文件到archive.tar,-f指定目标文件名,-c表示打包

    tar -cf archive.tar test.txt cmd.txt

    如果不解压,就只查看压缩包里的文件

    tar -tf archive.tar

    zip和unzip分别打包zip和解压unzip文件

    [root@gpslave1 home]# unzip greenplum-db-5.10.2-rhel7-x86_64.zip
    Archive:  greenplum-db-5.10.2-rhel7-x86_64.zip
      inflating: greenplum-db-5.10.2-rhel7-x86_64.bin  
    [root@gpslave1 home]# ll
    总用量 384496
    drwxr-xr-x. 2 root    root            6 9月   1 23:14 cdrom
    -rwxrwxrwx. 1 root    root           33 9月   2 17:45 cmd
    drwx------. 2 gpadmin gpadmin        62 9月  28 23:29 gpadmin
    -rwxr-xr-x. 1 root    root    197905185 8月  10 2018 greenplum-db-5.10.2-rhel7-x86_64.bin
    -rwxr-xr-x. 1 root    root    195802895 10月  9 02:01 greenplum-db-5.10.2-rhel7-x86_64.zip
    drwxr-xr-x. 2 root    root           76 9月   4 00:55 gz_test
    -rw-r--r--. 1 root    root          112 9月   4 00:43 gz_test.tar.gz
    -rwxrwxrwx. 1 root    root          113 9月   3 16:37 tar_test.tar
    -rwxrwxrwx. 1 root    root            0 9月   2 17:44 test.txt
    drwxr-xr-x. 3 root    root           34 9月   1 23:32 VMTools
    drwxr-xr-x. 9 root    root          175 11月 11 2015 vmware-tools-distrib

    参考:

    https://jingyan.baidu.com/article/9080802238d21dfd91c80fd5.html

  • 相关阅读:
    selenium python 启动Chrome
    安装selenium python
    网络编程32
    动态生成验证码———MVC版
    C#之发送邮件【模板】+【封装】ZJ版
    【转】解读ASP.NET 5 & MVC6系列(1):ASP.NET 5简介
    Cache,MemCache,Application,Cookie等其它缓存汇总
    点击弹出li所在的序列号
    【转】js实现复制到剪贴板功能,兼容所有浏览器
    前端效果——持续更新。。。
  • 原文地址:https://www.cnblogs.com/jenrrychen/p/15220286.html
Copyright © 2011-2022 走看看