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

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/ ./*


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

unzip -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/*

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

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

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: recorded a relatively complete development process in my hexo blog deployed on GitHub. You can […]