Linux uses zip, gzip, bzip2, XZ and other commands to compress files and directories

Time:2021-8-4
compress decompression explain
zip unzip Compatible with UNIX and windows, it can compress multiple files or directories
gzip gunzip Compress a single file, with low compression rate and low CPU overhead
bzip2 bunzip2 Compress a single file, with high compression rate and high CPU overhead
xz unxz Compressing a single file has the advantages of high compression rate, long time, fast decompression and high CPU overhead
#Compress all contents in the directory
zip -r /tmp/test.zip ./*

#Decompress
unzip test.zip

#Merge and compress multiple directories
zip -r /tmp/test.zip /test/ /etc/passwd

#Decompress到指定目录
unzip test.zip -d /tmp/backup/
#Compress a single file
gzip file1

#Recursively compress files in a directory
gzip -r dir/

#Unzip all compressed packages in the directory
gunzip dir/*

#Ibid
gzip -d dir/*
#Compress a single file
bzip2 file1

#Unzip all compressed packages in the directory
bunzip2 dir/*

#Ibid
bzip2 -d dir/*

Using the compression tool will change the attribute information of the file.

Recommended Today

SQL exercise 20 – Modeling & Reporting

This blog is used to review and sort out the common topic modeling architecture, analysis oriented architecture and integration topic reports in data warehouse. I have uploaded these reports to GitHub. If you are interested, you can have a lookAddress:https://github.com/nino-laiqiu/TiTanI recorded a relatively complete development process in my hexo blog deployed on GitHub. You can […]