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

How to package, compress and decompress files or directories under Linux

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

Share

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

This article will explain in detail how to package and compress and decompress files or directories under Linux. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Packaging, compression, decompression and other operations of files or directories under Linux

Compress

Tar-cvf jpg.tar * .jpg-package all jpg files in the directory into tar.jpg, but do not compress them

Tar-czf jpg.tar.gz * .jpg-after all the jpg files in the directory are packaged into jpg.tar and compressed with gzip, a gzip compressed package is generated, named jpg.tar.gz

Tar-cjf jpg.tar.bz2 * .jpg-after all the jpg files in the directory are packaged into jpg.tar and compressed with bzip2, a bzip2 compressed package is generated, named jpg.tar.bz2

Tar-cZf jpg.tar.Z * .jpg-after all the jpg files in the directory are packaged into jpg.tar and compressed with compress, a umcompress compressed package is generated, named jpg.tar.Z

Rar a jpg.rar * .jpg-for compression in rar format, you need to download rar for linux first

Zip jpg.zip * .jpg-for compression in zip format, you need to download zip for linux first

Decompression

Tar-xvf file.tar-extract the tar package

Tar-xzvf file.tar.gz-decompress tar.gz

Tar-xjvf file.tar.bz2-decompress tar.bz2

Tar-xZvf file.tar.Z-decompress tar.Z

Unrar e file.rar-decompress rar

Unzip file.zip-decompress zip

Summary

1. Tar is decompressed with tar-xvf

2. *. Gz is decompressed with gzip-d or gunzip

3. * .tar.gz and * .tgz are decompressed with tar-xzf

4. * .bz2 decompress with bzip2-d or bunzip2

5. * .tar.bz2 decompress with tar-xjf

6. * .Z is decompressed with uncompress, or gzip-d file.Z

7. Tar.Z is decompressed with tar-xZf

8. *. Rar decompressed with unrar e

9. *. Zip decompressed with unzip

On how to package and compress and decompress files or directories under Linux, this is it. I hope the above content can be helpful to everyone and learn more knowledge. If you think the article is good, you can share it for more people to see.

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