第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

Linux下各種壓縮解壓縮命令整理

標(biāo)簽:
Linux

命令安装

一般安装

yum install bzip2 gzip xz tar zip -y
yum install -y

rar/lzip特殊安装

rar shell脚本安装
lzip shell脚本安装

压缩解压缩

.bz2

bzip2 命令操作文件之后会删除删文件

## compressbzip2 filename.txt## uncomressbzip2 -d filename.txt.bz2bunzip2 filename.txt.bz2

bzcat 可以参看压缩文件内容


.gz

gzip 命令操作文件之后会删除删文件

# compressgzip filename.txt## uncompressgzip -d filename.txt.gzgunzip filename.txt.gz

.xz

## compressxz -[z] filename## uncompressunxz filename.xzxz -d filename.xz

xzcat 可以查看xz压缩的文件


tar

tar是打包解包工具,不是压缩解压缩工具

## packtar -cvf filename.tar file_or_DirName## unpacktar -xvf filename.tar

tar 常用参数解析

-c 创建新的tar包
-x 从tar包中解析或者提取文件
-v 创建或者解析时显示详细的文件
-f 生成的tar包文件或者从哪个tar包文件提取 `-f`是必须的,一般和-c或者-x等组合
-t 列举tar包中都有哪些文件
-j  打包并压缩成 `bzip2` 文件`tar.bz2`-J  打包并压缩成 `xz` 文件`tar.xz`-z  打包并压缩成 `gzip` 文件 `tar.gz`-Z  打包并压缩成 `compress` 文件`tar.Z`

.zip

## compresszip file.zip file_or_folder## uncompressunzip filename.zip

.rar

<span id="rar-install">rar的安装方式目前只能采用源码安装的方式,这里附rar shell安装脚本</span>

#!/usr/bin/env bash# -*- coding: utf-8 -*-#Filename:  /devOps/shell/common/installRar.sh#Author:        Liuchao#Email:     137642091@qq.com#Date:      2016-06-07#Desc:      Linux下安装 rar 命令#source /devOps/shell/common/functions
 ## wget http://www.rarsoft.com/rar/rarlinux-x64-5.4.b2.tar.gz## wget http://www.rarsoft.com/rar/rarlinux-5.4.b2.tar.gzmbit=$(uname -m|awk -F '_' '{print $2}')if [ "$mbit" == "64" ]then
    package="rarlinux-x64-5.4.b2.tar.gz"else
    package="rarlinux-5.4.b2.tar.gz"fi## uncompress and unpackuLog "uncompress and unpack ${package}"tar -zxvf ${package}## install uLog "installing"cd rar
make 

## delete old unuseful folderuLog "delete old unuseful folder"cd ..
rm -rf rar

rar 压缩和解压缩

## compressrar a file.rar file_or_folder## uncompressrar x file.rarunrar e file.rar

可以直接输入rar或者unrar回车查看具体用法


.Z

.Z 是 compress命令的后缀

## compresscompress filename## uncompressuncompress filename.Z

.lz

lzip 的安装方式目前只能采用源码安装的方式,这里附 <span id="lzip-install">lzip shell安装脚本</span>

#!/usr/bin/env bash# -*- coding: utf-8 -*-#Filename:  installLzip.sh#Author:        Liuchao#Email:     137642091@qq.com#Date:      2016-06-07#Desc:      Linux下安装 lzip 命令#source /devOps/shell/common/functions
 # http://download.savannah.gnu.org/releases/lzip/lzlib/lzlib-1.8.tar.gzpackage="lzlib-1.8.tar.gz"# uncompress and unpackuLog "unpack ..."tar -zxvf $package## compile and install cd lzlib-1.8
uLog "configure ..."./configure

uLog "make"make 

uLog "make isntall"make install

uLog "make install-as-lzip"make install-as-lzip## deleteuLog "delete temp folder"cd ..
rm -rf lzlib-1.8

lzip 压缩解压缩

## compresslzip filename## uncompresslzip -d filename.lz

lzip 可以通过--lzip 参数和tar命令结合

root@pts/4 $ tar --lzip -cvf  lzip.tar.lz file*
file1
file2
file3
Dev-web-solr [/tmp/liuchao] 2016-06-07 16:15:14root@pts/4 $ ls -l
total 12-rw-r--r-- 1 root root   0 Jun  7 16:14 file1
-rw-r--r-- 1 root root   0 Jun  7 16:14 file2
-rw-r--r-- 1 root root   0 Jun  7 16:14 file3
-rw-r--r-- 1 root root 147 Jun  7 16:15 lzip.tar.lz
Dev-web-solr [/tmp/liuchao] 2016-06-07 16:15:19root@pts/4 $ tar -tf lzip.tar.lz 
file1
file2
file3

参考

xz和tar结合使用
lzip介绍



作者:全栈运维
链接:https://www.jianshu.com/p/eb76dfbe96a5

點(diǎn)擊查看更多內(nèi)容
TA 點(diǎn)贊

若覺得本文不錯(cuò),就分享一下吧!

評(píng)論

作者其他優(yōu)質(zhì)文章

正在加載中
  • 推薦
  • 評(píng)論
  • 收藏
  • 共同學(xué)習(xí),寫下你的評(píng)論
感謝您的支持,我會(huì)繼續(xù)努力的~
掃碼打賞,你說(shuō)多少就多少
贊賞金額會(huì)直接到老師賬戶
支付方式
打開微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊(cè)有機(jī)會(huì)得

100積分直接送

付費(fèi)專欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會(huì)
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)

舉報(bào)

0/150
提交
取消