压缩解压

tar 即可压缩也可以解压

c 压缩    如果没有z、j参数,则表示,只打包,不压缩。 就说,

t 查看

z  以gzip方式压缩     相当于 gzip ?。。

j  以bzip方式压缩    bzip2 ??

drwxr-xr-x 5 root root 4096 Apr 21 09:30 etccc/  

tar cvf etccc.zip etccc/
-rw-r--r-- 1 root root 2027520 Apr 21 17:50 etccc.zip  

tar zcvf etccc.zip.gz etccc/        ----- 以zip.gz结尾不是必须的, 
-rw-r--r-- 1 root root 95930 Apr 21 17:51 etccc.zip.gz    --- 对比大小可见,压缩效果还是很显著的

gzip

gzip date.txt           貌似只能对文件进行gzip压缩,  不需要指定压缩目标文件名
linux:/opt/lktest/TEST # l
total 12
drwxr-xr-x 2 root root 4096 Apr 21 17:08 ./
drwxr-xr-x 31 root root 4096 Apr 21 09:29 ../
-rw-r--r-- 1 root root 34 Apr 21 17:07 date.txt.gz   ———— gzip压缩结果默认以gz结尾

linux:/opt/lktest # gzip TEST
gzip: TEST is a directory -- ignored

gunzip

zcat   zcat  is  identical  to gunzip -c

bzip    貌似没有bzip命令,只有bzip2

bzip2

linux:/opt/xx # bzip2
bzip2: I won't write compressed data to a terminal.
bzip2: For help, type: `bzip2 --help'.
linux:/opt/xx # bunzip2
bunzip2: I won't read compressed data from a terminal.
bunzip2: For help, type: `bunzip2 --help'.

SHELL在执行一个UNIX命令时,自动打开三个文件:stdin(标准输入)、stdout(标准输出
)、stderr(标准错误),文件描述字分别是0、1、2。所以,上面语句中的"2"表示标准错误的

标准输出 ? 如何重定向?

compress  ? 好像还需要安装,我本机是不可以执行的。

参考

http://www.cnblogs.com/Thomson-Blog/articles/1335034.html

linux 之 压缩 / 解压的更多相关文章

  1. Linux命令-压缩解压命令:gzip、gunzip

    gzip [选项] 源文件名(压缩前) gunzip [选项] 源文件名(压缩后) cd /tmp 切换tmp目录 rm -rf * 强制删除tmp目录下面所有的文件和目录 touch beijing ...

  2. Linux打包压缩解压工具

    第1章      Linux 打包压缩解压工具一.压缩.解压工具 compress/uncompress gzip/gunzip bzip2/bunzip2/ bzcat xz/unxz/ xzcat ...

  3. Linux的压缩解压命令快速上手——解压篇

    在Linux系统中,压缩文件通常是先将若干文件(包括目录)打包成一个tar文件,然后再调用压缩程序将tar文件压缩成相应的压缩包,这也就是为什么Linux系的压缩包的后缀通常都是像tar.gz,tar ...

  4. linux命令:压缩解压命令

    压缩解压命令:gzip 命令名称:gzip 命令英文原意:GNU zip 命令所在路径:/bin/gzip 执行权限:所有用户 语法:gzip 选项  [文件] 功能描述:压缩文件 压缩后文件格式:g ...

  5. Linux命令--压缩解压(简化版)

    Linux tar.gz.tar.bz2.zip 等解压缩.压缩命令详解(简化版) Linux 常用的压缩与解压缩命令有:tar.gzip.gunzip.bzip2.bunzip2.compress ...

  6. linux系统压缩\解压命令详解

    转自:http://www.cnblogs.com/qq78292959/archive/2011/07/06/2099427.html. tar -c: 建立压缩档案-x:解压-t:查看内容-r:向 ...

  7. [Linux] 016 压缩解压命令

    1. 压缩解压命令:gzip 命令名称:gzip 命令所在路径:/bin/gzip 执行权限:所有用户 语法:gzip [文件] 功能描述:压缩文件 压缩后文件的格式:.gz 补充: 解压 .rar ...

  8. linux的压缩解压命令全解

    .tar 解包:tar xvf FileName.tar打包:tar cvf FileName.tar DirName(注:tar是打包,不是压缩!)——————————————— .zip解压:un ...

  9. linux shell 压缩解压命令

    .tar 解包:tar xvf FileName.tar打包:tar cvf FileName.tar DirName(注:tar是打包,不是压缩!)———————————————.gz解压1:gun ...

随机推荐

  1. hdu2068 RPG的错排 组合数/递推

    #include<stdio.h> ]; long long c(int a,int b) { ,j; ;i>=a-b+,j<=b;i--,j++) sum=sum*i/j; ...

  2. ajax完整请求

    @RequestMapping(value = "/quotaPage") // , method = RequestMethod.GET名额分配@ResponseBody //注 ...

  3. IntelliJ IDEA 2017激活

    最新更新: 在激活Jetbrains旗下任意产品的时候选择激活服务器 填入以下地址便可成功激活 http://idea.liyang.io 点击help→Register→License sever ...

  4. MySQL只有.frm文件恢复表结构

    http://www.ttlsa.com/mysql/mysql-utilities-mysqlfrm/ 以诊断模式读取目录中的所有的FRM文件: D:\Program Files (x86)\Eas ...

  5. linux修改文件所有者和文件所在组

      chgrp  用户名    文件名  -R chown 用户名   文件名  -R -R表示递归目录下所有文件 以上部分已验证 一.修改文件所属组群——chgrp    修改文件所属组群很简单-c ...

  6. 基于TLS(线程局部存储)的高效timelog实现

    什么是timelog? 我们在分析程序性能的时候,会加入的一些logging信息记录每一部分的时间信息 timelog模块的功能就是提供统一的接口来允许添加和保存logging 我们正在用的timel ...

  7. bzoj 4566 [Haoi2016]找相同字符——广义后缀自动机

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=4566 每个后缀结尾处 ct[ ] = 1 ,按拓扑序 dp 一下就能求出 right 集合的 ...

  8. phper必知必会之类库自动加载的七种方式(三)

    ## php自动加载 下面显示例子的文件目录结构图 一.没有使用命名空间的几种实现 test/oneClass.php class oneClass{ public function show(){ ...

  9. (文章转载)织梦CMS判断不同的栏目显示不同的图片

    {dede:php} $thisid = $refObj->Fields['id']; $row = $dsql->GetOne("Select typeid From `ybs ...

  10. linux 搭建 redis

    找了很多教程总有一个适合我 http://www.cnblogs.com/_popc/p/3684835.html 当然我的目录是/opt/redis   文章中的目录是/usr/local/redi ...