zoukankan      html  css  js  c++  java
  • 005_Linux压缩文件命令

    1. zip/unzip --- zip格式
    压缩文件
    root@ubuntu:~/Test# zip  Test.zip hello.c hello.c.hard
      adding: hello.c (deflated 12%)
      adding: hello.c.hard (deflated 12%)
    root@ubuntu:~/Test# ls
    hello.c  hello.c.hard  hello.c.hard1  hello.c.soft  shell  test  Test.zip
    
    解压文件
    root@ubuntu:~/Test# rm -rf hello.c hello.c.hard
    root@ubuntu:~/Test# ls
    hello.c.hard1  hello.c.soft  shell  test  Test.zip
    root@ubuntu:~/Test# unzip Test.zip 
    Archive:  Test.zip
      inflating: hello.c                 
      inflating: hello.c.hard            
    
    • 备注:如果zip -r ---代表递归子目录
    1. Linux最常用打包命令:tar(后缀一般为.tar.gz)
    • tar [option] 压缩包名 原材料
      • -c---压缩文件
      • -v---显示信息
      • -f---指定压缩包名
      • -z---gz格式格式压缩
    压缩文件
    root@ubuntu:~/Test# tar zcvf hello.tar.gz hello.c hello.c.hard
    hello.c
    hello.c.hard
    root@ubuntu:~/Test# ls -l hello.tar.gz 
    -rw-r--r-- 1 root root 217 12月 10 23:30 hello.tar.gz
    解压文件
    root@ubuntu:~/Test/test# ls
    hello.tar.gz
    root@ubuntu:~/Test/test# tar zxvf hello.tar.gz 
    hello.c
    hello.c.hard
    root@ubuntu:~/Test/test# ls
    hello.c  hello.c.hard  hello.tar.gz
    
  • 相关阅读:
    常见排序算法总结(一)
    27.移除元素
    556. 下一个更大元素 III
    503. 下一个更大元素 II
    496.下一个更大元素Ⅰ
    汇编基础
    SQL回顾
    Pandas整理
    爬取中公网新闻时政
    Python合并Excel表格
  • 原文地址:https://www.cnblogs.com/LittleFishC/p/14317208.html
Copyright © 2011-2022 走看看