压缩和解压缩文件bzip2 options] [file-list]

bunzip2 [options] [file-list]

bzcat [options] [file-list]

bzip2recover [file]

bzip2程序用来压缩文件,bunzip2用来还原bzip2压缩的文件,bzcat用于显示bzip2压缩文件,bzip2recover用于修复bzip2压缩时损坏的文件

参数

file-list为要压缩/解压缩的一个或多个文件路径名列表

选项

-c              将压缩或者解压缩的结果写到标准输出

-d              解压缩用bzip2压缩的文件,该选项用于bzip2 -d,与bunzip2等价

-f               强制压缩,覆盖已经存在的文件

-k              当压缩或者解压缩文件时不删除输入文件

-q              抑制警告信息,但显示关键信息

-t               验证压缩文件的完整性,如果文件完整,则不显示任何信息

-v              显示压缩或解压缩时的过程信息

示例

bzip2

siu@Darling ~/work $ ls
a b c dir
siu@Darling ~/work $ bzip2 a
siu@Darling ~/work $ ls
a.bz2 b c dir

压缩文件

bzip2 -v

siu@Darling ~/work $ bzip2 -v b
b: 1.123:1, 7.121 bits/byte, 10.99% saved, 182 in, 162 out.
siu@Darling ~/work $ ls
a.bz2 b.bz2 c dir

压缩文件并显示压缩信息

bzcat

siu@Darling ~/work $ bzcat a.bz2
Picture perfect memories scattered all around the floor
Reaching for the phone 'cause I can't fight it anymore
And I wonder if I ever cross your mind
For me it happens all the time

显示压缩文件的内容

bunzip2

siu@Darling ~/work $ bunzip2 a.bz2
siu@Darling ~/work $ ls
a b.bz2 c dir

解压文件

bunzip2 -k

siu@Darling ~/work $ bunzip2 -k b.bz2
siu@Darling ~/work $ ls
a b b.bz2 c dir

解压文件,并保留原文件

Tips

bzip2程序的压缩效率比gzip要好

bzip2的更多相关文章

  1. 压缩和解压文件:tar gzip bzip2 compress(转)

    tar[必要参数][选择参数][文件] 压缩:tar -czvf filename.tar.gz targetfile解压:tar -zxvf filename.tar.gz参数说明: -c 建立新的 ...

  2. Linux下的压缩和解压缩命令——bzip2/bunzip2

    bzip2命令 bzip2命令用于创建和管理(包括解压缩)".bz2"格式的压缩包. 我们遇见Linux压缩打包方法有很多种,以下讲解了Linux压缩打包方法中的Linux bzi ...

  3. gzip、bzip2、tar压缩命令使用

    1. gzip gzip test.txt //压缩 gzip -d test.txt.gz //解压缩 gzip -9 test.txt //设置压缩等级(9最好,1最差,默认6) 相关:zcat ...

  4. php编译报错 configure: error: Please reinstall the BZip2 distribution

    yum install -y bzip2 bzip2-devel

  5. linux笔记:压缩解压命令gzip,gunzip,tar,zip,unzip,bzip2,bunzip2

    命令名称:gzip功能:压缩文件命令所在路径:/bin/gzip用法:gzip 文件压缩后文件格式:.gz其他:压缩后不保留原文件:只能压缩文件,不能压缩目录 命令名称:gunzip功能:解压.gz格 ...

  6. <转>如何利用多核CPU来加速你的Linux命令 — awk, sed, bzip2, grep, wc等

    原文链接:http://www.vaikan.com/use-multiple-cpu-cores-with-your-linux-commands/ 你是否曾经有过要计算一个非常大的数据(几百GB) ...

  7. Compress、tar、gzip、zcat、bzip2、bzcat、打包解压命令行

    讲解内容: Linux环境中,压缩文件案的扩展名大多是*.tar,*.tar.gz,*.tgz,*.gz,*.Z,*.bz2. *.z             compress程序亚索的文件: *.g ...

  8. 转摘--如何利用多核CPU来加速你的Linux命令 — awk, sed, bzip2, grep, wc等

    http://www.vaikan.com/use-multiple-cpu-cores-with-your-linux-commands/ 你是否曾经有过要计算一个非常大的数据(几百GB)的需求?或 ...

  9. 如何利用多核CPU来加速你的Linux命令 — awk, sed, bzip2, grep, wc等(转)

    你是否曾经有过要计算一个非常大的数据(几百GB)的需求?或在里面搜索,或其它操作——一些无法并行的操作.数据专家们,我是在对你们说.你可能有一个4核或更多核的CPU,但我们合适的工具,例如 grep, ...

  10. linux中的一些基础命令的使用(which,whereis,locate,find,alias,file,ls,cat,echo,tar,bzip2,gzip,history,mv,cp,rm)

    which whereis locate find alias file ls cat echotar bzip2 gzip history mv cp rm -------------------- ...

随机推荐

  1. php里面的变量的使用

    php里面的变量一般可以直接使用不需要声明,但是这种var_dump($a);就会报错,还有sql语句里面如果某个变量为空也会报错. 如果变量为null,空,未声明都==false,但是不===fal ...

  2. Ubuntu16.04 + Zabbix 3.4.7 邮件报警设置

    部署了Zabbix,需要配置邮件报警,在网上找了一些教程,大多是是用的CentOS + Zabbix 2.x版本的,而且还要写脚本,感觉太麻烦了,所以自己结合其他文章摸索了一套配置方法. 先说一下环境 ...

  3. Python-socket网络编程-Day8

    目录Day8-Python socket 11.Socket 11.1.socket和file的区别: 11.2.WEB服务应用: 21.3.更多功能 21.4.socket方法: 41.5. 服务端 ...

  4. layui中进行form表单一些问题

    最近一段时间一直在用layui来写一些前段页面,发现有几个问题,不知道是我的编译器的问题还是什么,总之目前是自己改成功了,在这里分享下. 第一个是用layui去写单选按钮,网页上不会显示出来.解决方法 ...

  5. iot前台开发环境:搭建 SpringBoot+angularJs2

    参考网站 Angular 中文官网:https://angular.cn/ 参考代码:https://ng.ant.design/#/components/dropdown  npm install ...

  6. Linux实战案例(1)CentOS修改主机名(hostname)

    1.临时修改主机名 显示主机名: oracle@localhost:~$ hostname localhost 修改主机名: oracle@localhost:~$ sudo hostname orc ...

  7. 译《Time, Clocks, and the Ordering of Events in a Distributed System》

    Motivation <Time, Clocks, and the Ordering of Events in a Distributed System>大概是在分布式领域被引用的最多的一 ...

  8. drupal8的安装

    一.首先安装好linux系统虚拟机 1.在drupal官网上下载drupal包,https://www.drupal.org/download 我下载的是 https://ftp.drupal.org ...

  9. 【django之Ajax】

    一.Ajax的简介 1.定义 AJAX(Asynchronous Javascript And XML)翻译成中文就是"异步Javascript和XML",是一种创建交互式网页应用 ...

  10. Topcoder口胡记 SRM 562 Div 1 ~ SRM 599 Div 1

    据说做TC题有助于提高知识水平? :) 传送门:https://284914869.github.io/AEoj/index.html 转载请注明链接:http://www.cnblogs.com/B ...