We often encounter decompression of large *. zip files under linux. Generally, winrar is often used to extract files directly in smb, but there may be a long Decompression Time and sometimes network errors. Therefore, I checked the linux decompression tool.
1. the linux unzip command can decompress the zip file in windows.
Unzip command
Syntax: unzip [Option] compressed file name. Zip
The meanings of each option are as follows:
-X file list: Decompress the file, but does not include the specified file.
-V.
-T whether the test file is damaged, but the pressure is not solved.
-D directory: Decompress the compressed file to the specified directory.
-Z only displays the annotation of the compressed file.
-N does not overwrite existing files.
-O overwrites existing files and does not require user confirmation.
-J. Do not recreate the directory structure of the document and decompress all the files to the same directory.
Example 1: extract text.zip from the current directory.
$ Unzip test.zip
Example 2: Decompress the compressed file text.zip under the specified directory/tmp. If the same file already exists, the unzip command must not overwrite the original file.
$ Unzip-n test.zip-d/tmp
Example 3: view the directory of the compressed file.
$ Unzip-v test.zip
Zgrep command
The function of this command is to find a matching regular expression in a compressed file. The usage is the same as that of the grep command, except that the object operated is a compressed file. You can use the zgrep command to check whether a certain sentence exists in a compressed file.
2. Run the tar command
Format: tar [Option] [file directory list]
Function: Package and back up the file directory.
Option:
-C create a new archive file
-R: append an object to the end of the archive object
-X solve the file from the archive file
-O unlocks the file to the standard output
-V output related information during processing
-F operations on common files
-Z calls gzip to compress the archive file, and CALLS gzip to decompress the archive file when it is used with-x.
-Z calls compress to compress the archive file, and CALLS compress to decompress the archive file when it is connected to-x.
Example 1: use tar to package files in a directory:
Tar-cf archive.tar foo bar # Create archive.tar from files foo and bar.
Example 2: List all files in the *. tar package
Tar-tvf archive.tar # List all files in archive.tar verbosely.
Example 3: Decompress the file
Tar-xf archive.tar # Extract all files from archive.tar.
Example 4: extract the * .tar.bz2 File
Tar-xjvf test.tar.bz2
Example 5: extract the * .tar.gz File
Tar-xzvf test.tar.gz or tar-xzvf test.tar. z
If tar does not support the-j parameter, you can use it as follows:
Bzip2-d xxx.tar.bz2
Tar xvf xxx.tar
From andyhuabing's column