Linux圧縮解凍

976 ワード

書式:
zip
gz
bzip2
tar
ツール:
zip
zip hello.c       
unzip  hello.c.zip   
zip -r hello     
zip hello.zip   
gzip
gzip hello.c       
gzip -d hello.c.gz   
gzip -c hello.c                 
bzip2
bzip hello.c       
bzip -d hello.c.bz2   
bzip -c hello.c                 
tarは、1つのファイルまたは1つのディレクトリを個別のファイルにパッケージ化する(gzipおよびbzip2がディレクトリをパッケージ化できない欠陥を解決することができる)
tar -cf archive.tar foo bar  
# Create archive.tar from files foo and bar.
tar -tvf archive.tar         
# List all files in archive.tar verbosely.   v        
tar -xf archive.tar          
# Extract all files from archive.tar.
tar -zcvf hello.tar.gz hello 
  c     , z     gz  
tar -zxvf hello.tar.gz 
  x     , z    gz      
tar -jcvf hello.tar.gz hello 
  c     , j     gz  
tar -jxvf hello.tar.gz 
  x     , j    gz