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

The method of decompressing the file to the specified directory by Linux

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

Share

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

This article introduces the method of decompressing files to a specified directory by Linux and sharing them with you. The details are as follows:

Tar is a commonly used packaging, compression and compression tool on Linux. It has many parameters, but it only enumerates the commonly used compression and decompression parameters.

Parameters:

-c: create creates parameters for compressed files;-x: parameters for decompressing compressed files;-z: whether gzip compression is required;-v: displaying files during compression;-f: top document name, followed by file name immediately after f, no more parameters can be added.

For example: first, package all the files in the entire / home/www/images directory into / home/www/images.tar

Tar-cvf / home/www/images.tar / home/www/images ← is packaged only, not compressed tar-zcvf / home/www/images.tar.gz / home/www/images ← is packaged and compressed with gzip

The compressed file name after the parameter f is chosen by yourself, and it is customary to use tar to do it. If the z parameter is added, tar.gz or tgz is used to represent the gzip compressed tar file file.

1 extract the tgz file to the specified directory

Tar zxvf test.tgz-C specified directory

For example, extract / source/kernel.tgz to the / source/linux-2.6.29 directory

Tar zxvf / source/kernel.tgz-C / source/ linux-2.6.29

2 compress the specified directory to the specified file

For example, compress the linux-2.6.29 directory to kernel.tgz

Tar czvf kernel.tgz linux-2.6.29

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

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