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 specify the extracted files to the directory in Linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article introduces the relevant knowledge of "how to assign the extracted files to the directory in Linux". In the operation of the actual case, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

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: parameters for create to create compressed files

-x: parameters for unzipping compressed files

-z: whether gzip compression is required

-v: display files during compression

-f: set the document name at the top, followed by the file name immediately after f. No 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 only packaged, but not compressed. After tar-zcvf / home/www/images.tar.gz / home/www/images ← is packaged, the name of the compressed file compressed by gzip after the parameter f is chosen by yourself. It is customary to use tar to do it. If the z parameter is added, the gzip compressed tar file file is represented by tar.gz or tgz.

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``Kernel``.tgz-C ``/ source/`` linux-2.6.292 compresses 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 "how to specify the decompressed files in the directory in Linux" is introduced here. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

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

Development

Wechat

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

12
Report