「Linux」tar.gzファイル、tarファイルの解凍、圧縮コマンド

1.tar.gz
圧縮
#tar -zcvf sample.tar.gz ディレクトリ名

#tar -zcvf cft.tar.gz html
html/
html/404.html
html/50x.html
html/index.html
html/nginx-logo.png
html/poweredby.png

 

解凍
#tar -zxvf sample.tar.gz

 

2.zip
圧縮
#zip -r sample.zip ディレクトリ名

# zip -r cft.zip html
adding: html/ (stored 0%)
adding: html/404.html (deflated 70%)
adding: html/50x.html (deflated 70%)
adding: html/index.html (deflated 69%)
adding: html/nginx-logo.png (deflated 2%)
adding: html/poweredby.png (stored 0%)
#

解凍
#unzip sample.zip

3.tar
圧縮
#tar -cvf sample.tar ディレクトリ名

# tar -cvf cft.tar modules
modules/
modules/mod-http-perl.conf
modules/mod-mail.conf
modules/mod-http-geoip.conf
modules/mod-http-image-filter.conf
modules/mod-stream.conf
modules/mod-http-xslt-filter.conf

解凍
#tar -xvf sample.tar

Linux

Posted by arkgame