zoukankan      html  css  js  c++  java
  • Linux命令-tar

    • tar命令用于对文件打包压缩或解压
    • 格式:tar [选项 -C 指定解压到的目录] [文件]
    • 打包并压缩文件:
    tar -zcvf 压缩包名.tar.gz 文件名
    • 解压并展开压缩包
    tar -zxvf 压缩包名.tar.gz
    [root@localhost testB]# ls
    111.txt  222.txt
    
    将111.txt文件通过gzip打包保存文件名111.tar.gz [root@localhost testB]# tar zcvf
    111.tar.gz 111.txt 111.txt [root@localhost testB]# ls 111.tar.gz 111.txt 222.txt [root@localhost testB]# rm -rf 111.txt [root@localhost testB]# ls 111.tar.gz 222.txt
    解压111.tar.gz到当前目录
    [root@localhost testB]# tar zxvf
    111.tar.gz 111.txt [root@localhost testB]# ls 111.tar.gz 111.txt 222.txt
    解压111.tar.gz到指定目录/root/testC下 [root@localhost testB]# tar
    -zxvf 111.tar.gz -C /root/testC/ 111.txt [root@localhost testB]# ll /root/testC/ 总用量 4 -rw-r--r--. 1 root root 3 9月 7 15:23 111.txt
  • 相关阅读:
    Linux filesystem
    centos 下 gradle 编译打包 apk
    python SSL 错误
    nginx 缓存配置
    nginx 反向代理配置
    redhat 网卡绑定
    磁盘阵列
    Centos 安装Django2.1
    python pyquery 基本用法
    python 爬虫之-- 正则表达式
  • 原文地址:https://www.cnblogs.com/tdcqma/p/5849721.html
Copyright © 2011-2022 走看看