Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example usage of zip Compression and decompression Command in Linux

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "the example usage of zip compression and decompression command in Linux". In daily operation, I believe that many people have doubts about the usage of zip compression and decompression command examples in Linux. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "zip compression and decompression command instance usage in Linux". Next, please follow the editor to study!

1. Compress ordinary files

Format: zip archive name source file

Ls#bk Common desktop.ini develop my little movie .txtzip nothing to see .zip my little movie .txt # adding: my little movie .txt (deflated 27%) ls#bk Common desktop.ini develop my little movie .txt nothing to see .zip

Summary: commands in the format of zip zip package name source file retain the source file's

2. Compress the directory

Format: zip-r compressed package name source directory

Pwd#/mnt/c/Users/bingobugbow/Desktop/ I am the directory cd.. ls#bk Common desktop.ini develop I am the directory zip-r directory. Zip I am the directory / # adding: I am the directory / (stored 0%) # adding: I am the directory / my little movie .txt (deflated 27%) # adding: I am the directory / nothing to see .zip (stored 0%) ls#bk Common desktop.ini develop I am the directory .zip

Summary: the source directory is also retained

3. Decompress ordinary files

Format: unzip package

Ls# nothing to see .zipunzip nothing to see .zip # Archive: nothing to look at .zip # inflating: my little movie .txtls # my little movie .txt nothing to see .zip

Conclusion: when decompressing, the original compressed package will also exist, which is equivalent to taking out the contents of the compressed package.

4. Decompress the directory

Format: unzip package

Ls#bk Common desktop.ini develop directory .zipunzip directory .zip # Archive: directory .zip # creating: I am directory / # inflating: I am directory / my little movie .txt # extracting: I am directory / nothing look .zipls # bk Common desktop.ini develop I am directory .zip

Summary: as with the unzipped files, the source package will be retained

Zip decompression and compression in this case without any parameters (- r, and when decompression, the directory does not need to add-r) parameters are excluded. Will keep the source file. The source file here refers to the source compressed file and the compressed package that has been compressed.

At this point, the study on the "zip compression and decompression command instance usage in Linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report