In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Today, the editor will bring you an article about the command of linux compressed files. The editor thinks it is very practical, so I will share it for you as a reference. Let's follow the editor and have a look.
I. zip format
Zip is probably the most widely used document compression format today. Its biggest advantage is that it is used on different operating system platforms. The disadvantage is that the compression ratio supported is not very high, and tar.gz and tar.bz2 do a very good job in compression ratio.
We can compress a file using the following command:
Zip-r archive_name.zip filename #-r is a compressed file
Here is how to extract a zip file:
Unzip archive_name.zip # (extract the file under the current file) unzip archive_name.zip-d new_dir # (extract the file to a directory you specify, using the-d parameter)
II. Tar format
Tar is a very widely used document packaging format in Linux. The advantage is that it consumes very little CPU and time to package files, it is just a packaging tool and is not responsible for compression. Here is how to package a directory:
Tar-cvf archive_name.tar directory_to_compress
Parameters:
The-c parameter is to create a new archive
The-v parameter shows the processed file in detail
The-f parameter specifies the archive or device
How to unpack after packing:
Tar-xvf archive_name.tar
The above unpacking command will unpack the document under the current directory. Of course, you can also use the following command to unpack to the specified path:
Tar-xvf archive_name.tar-C new_dir # (unpacking parameter is-C, not lowercase c)
III. Tar.gz format
It does not take up too much CPU when compressing, and it can get a very ideal compression ratio.
Compression method:
Tar-zcvf archive_name.tar.gz filename
Decompression method:
Tar-zxvf archive_name.tar.gz
The above unpacking command will unpack the document under the current directory. Of course, you can also use the following command to specify the path to unpack:
Tar-zxvf archive_name.tar.gz-C new_dir
IV. Tar.bz2 format
This compression format has the best compression ratio of all the methods we have mentioned. Of course, this means that it takes up more CPU and time than the previous approach.
Compression mode
Tar-jcvf archive_name.tar.bz2 filename
Decompression method:
Tar-jxvf archive_name.tar.bz2
The above unpacking command will unpack the document under the current directory. Of course, you can also use the following command to specify the path to unpack:
Tar-jxvf archive_name.tar.bz2-C new_dir
The above is a brief introduction of the linux compressed file command, the detailed use of the need for you to use their own hands to understand. If you want to know more about it, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.