Linux常用的壓縮命令
1. compress
在預設情況下,被compress壓縮的原始檔會不見,而壓縮檔案會被自動建立起來,副檔名為.Z,如:
$ cp /etc/man.config .
$ compress -v man.config
man.config: -- replaced with man.config.Z Compression: 41.83%
$ ll
total 3
-rw-r--r-- 1 a105024 sybase 2687 Jan 4 06:21 man.config.Z
解壓縮用uncompress即可,如:
$ uncompress man.config.Z
$ ll
total 5
-rw-r--r-- 1 a105024 sybase 4620 Jan 4 06:21 man.config
如果想保留原始檔,則用如下命令:
$ compress -c man.config > man.config.Z
$ ll
total 8
-rw-r--r-- 1 a105024 sybase 4620 Jan 4 06:21 man.config
-rw-r--r-- 1 a105024 sybase 2687 Jan 4 06:29 man.config.Z
最後強調一下,compress是一款非常舊的壓縮軟體,已經很少有人使用了。
2. gzip
和compress一樣,在預設情況下,原始檔會不見,壓縮後的副檔名為.gz,如:
$ gzip -v man.config
man.config: 56.2% -- replaced with man.config.gz
$ ll
total 6
-rw-r--r-- 1 a105024 sybase 2059 Jan 4 06:21 man.config.gz
zcat命令可以讀取被壓縮後的檔案內容。
解壓縮用gunzip命令:
$ gunzip man.config.gz
$ ll
total 8
-rw-r--r-- 1 a105024 sybase 4620 Jan 4 06:21 man.config
3. bzip2
bzip2的用法和gzip幾乎一模一樣,壓縮後的副檔名為.bz2,還可以用bzcat讀取被壓縮後的檔案內容。
4. tar
幾個主要引數如下:
-c 新建打包檔案
-t 查詢打包檔案中含有哪些檔名
-x 解壓打包檔案
-j 通過bzip2進行解壓縮
-z 通過gzip進行解壓縮
-f 後面接檔名
常用方法如下:
1)壓縮並打包:tar -cvzf *.tar.gz
2)查詢打包檔案:tar -tvzf *.tar.gz
3)解壓縮:tar -xvzf *.tar.gz -C 欲解壓縮的命令
在預設情況下,被compress壓縮的原始檔會不見,而壓縮檔案會被自動建立起來,副檔名為.Z,如:
$ cp /etc/man.config .
$ compress -v man.config
man.config: -- replaced with man.config.Z Compression: 41.83%
$ ll
total 3
-rw-r--r-- 1 a105024 sybase 2687 Jan 4 06:21 man.config.Z
解壓縮用uncompress即可,如:
$ uncompress man.config.Z
$ ll
total 5
-rw-r--r-- 1 a105024 sybase 4620 Jan 4 06:21 man.config
如果想保留原始檔,則用如下命令:
$ compress -c man.config > man.config.Z
$ ll
total 8
-rw-r--r-- 1 a105024 sybase 4620 Jan 4 06:21 man.config
-rw-r--r-- 1 a105024 sybase 2687 Jan 4 06:29 man.config.Z
最後強調一下,compress是一款非常舊的壓縮軟體,已經很少有人使用了。
2. gzip
和compress一樣,在預設情況下,原始檔會不見,壓縮後的副檔名為.gz,如:
$ gzip -v man.config
man.config: 56.2% -- replaced with man.config.gz
$ ll
total 6
-rw-r--r-- 1 a105024 sybase 2059 Jan 4 06:21 man.config.gz
zcat命令可以讀取被壓縮後的檔案內容。
解壓縮用gunzip命令:
$ gunzip man.config.gz
$ ll
total 8
-rw-r--r-- 1 a105024 sybase 4620 Jan 4 06:21 man.config
3. bzip2
bzip2的用法和gzip幾乎一模一樣,壓縮後的副檔名為.bz2,還可以用bzcat讀取被壓縮後的檔案內容。
4. tar
幾個主要引數如下:
-c 新建打包檔案
-t 查詢打包檔案中含有哪些檔名
-x 解壓打包檔案
-j 通過bzip2進行解壓縮
-z 通過gzip進行解壓縮
-f 後面接檔名
常用方法如下:
1)壓縮並打包:tar -cvzf *.tar.gz
2)查詢打包檔案:tar -tvzf *.tar.gz
3)解壓縮:tar -xvzf *.tar.gz -C 欲解壓縮的命令
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26277071/viewspace-714423/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Linux 常用的壓縮與解壓縮命令詳解Linux
- linux常用壓縮解壓複製下載命令Linux
- Linux常用命令之檔案壓縮與解壓縮命令詳解Linux
- linux下壓縮解壓縮命令Linux
- linux壓縮和解壓縮命令整理Linux
- 常用壓縮命令彙總
- Linux下的tar壓縮解壓縮命令詳解Linux
- linux檔案壓縮和解壓命令Linux
- linux下壓縮、解壓命令大全Linux
- linux命令系列-zip(壓縮打包)Linux
- Linux下解壓命令、壓縮命令大全,詳細教程Linux
- 『學了就忘』Linux基礎命令 — 32、壓縮和解壓縮相關命令Linux
- Linux下如何安裝、壓縮、解壓軟體包?常用命令彙總!Linux
- linux中常見的打包壓縮命令——tar、jarLinuxJAR
- Linux命令:XZ解壓tar.xz字尾的壓縮包Linux
- Linux中檔案的壓縮和解壓縮Linux
- Linux常用的檔案解壓命令有哪些?Linux
- Linux壓縮解壓Linux
- linux 高效壓縮工具之xz的壓縮解壓使用Linux
- Linux中常用的命令都是哪些單詞的縮寫?Linux
- Linux tar分卷壓縮與解壓縮Linux
- 壓縮或解壓檔案用的Linux命令?linux開發入門與實戰Linux
- linux分卷壓縮解壓Linux
- Linux下lz4解壓縮命令小結Linux
- Linux之壓縮Linux
- 【Linux基礎】壓縮和解壓Linux
- Linux打包壓縮解壓工具Linux
- 壓縮命令tar詳解
- Ubuntu 壓縮檔案命令Ubuntu
- Linux下檔案的壓縮與解壓Linux
- Linux 檔案壓縮Linux
- 常用的linux命令Linux
- CentOS中zip壓縮和unzip解壓縮命令詳解CentOS
- 快速上手Linux核心命令(九):檔案備份與壓縮Linux
- Linux有問必答:如何在命令列下壓縮JPEG影像Linux命令列
- Linux(四):Linux的打包和壓縮詳解Linux
- 在 Linux 上壓縮檔案:zip 命令的各種變體及用法Linux
- linux 下面壓縮、解壓.rar檔案Linux
- DBA常用的linux命令Linux