2019年3月12日 星期二

【LINUX】壓縮、解壓縮指令

副檔名解壓壓縮(檔案→紅色壓縮後)查看檔案內容
*.tartar -xvf 檔案tar -cvf test.tar 要壓的資料夾 
*.gzgzip -d 檔案 或 gunzip 檔案gzip 檔案zcat 檔案.gz
*.tar.gztar -xzf 檔案tar -czf test.tar.gz 要壓的資料夾 
*.tgz(同上)tar -xzf 檔案tar -czf test.tar.gz 要壓的資料夾 
*.bz2bzip2 -d 或bunzip2 檔案bzip2 -z 檔案bzcat 檔案.bz2
*.tar.bz2tar -xjf 檔案tar -cjf test.tar.bz2 要壓的資料夾 
*.Zuncompress 檔案 或
compress -d 檔案
需另外安裝 compress 要壓的資料夾 
*.tar.Ztar -xZf 檔案tar -cZf test.tar.Z 要壓的資料夾
需另外安裝
 
*.rar unrar e 檔案rar a test.rar 要壓的資料夾 
*.zipunzip 檔案zip -r 檔案名.zip 要壓的資料夾less 檔案.zip
*.tar.xz          tar jxvf 檔案                           tar Jcvf  檔案名.tar.xz 要壓的資料夾                             

常用的參數說明:
-c: 建立壓縮檔案
-f:指定建立的檔案名稱
-v:顯示建立的過程"
-x:解壓(解打包)即解開打包
-r:向壓縮歸檔檔案末尾追加檔案
-u:更新原壓縮包中的檔案
-t:檢視內容
-z:具gzip的屬性
-p:使用原來的檔案屬性 



例:
tar zxvf mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz -C /usr/local/
解一個mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz的壓縮檔,解完移至/usr/local/下

                      

沒有留言:

張貼留言

【MYSQL】MYSQL的SYS表說明(版本8.0)

mysql> use sys Reading table information for completion of table and column names You can turn off this feature to get a quicker s...