Http://hi.baidu.com/ggwork/blog/item/d52c48245e823923d40742b9.html
For those who are new to Linux, they will surely get dizzy with a bunch of various file names in Linux. OtherFor example, we know that there are only two common types of
Zip:Compression:Zip [-acddffghjjkllmoqrstuvvwxyz$][-b ][-ll][-n ][-t ][-][compressed file] [ File ...] [-i Extract:Unzip [options] Compress file name. zipOptions:-X file list to unzip the file, but not include the specified file file.-V View the
Linux under the Tar decompression GZ decompression bz2 and so on various decompression file use method
. tar
Unpack: Tar xvf Filename.tar
Packing: Tar cvf filename.tar dirname
(Note: Tar is packed, not compressed.) )
———————————————
.
In. NET 2.0, you can use sharpziplib, an open source DLL, to easily decompress ZIP files and GZ files.
You can download sharpziplib here.
The following describes the specific code:
1. Unzip the ZIP file:
Namespace: icsharpcode. sharpziplib.
. tarUnpacking: Tar xvf Filename.tarPackage: Tar cvf filename.tar DirName(Note: Tar is packaged, not compressed!) )———————————————. gzDecompression 1:gunzip filename.gzDecompression 2:gzip-d filename.gzCompression: gzip FileName. tar.gz and.
The most common packaging program under Linux is tar, which is often referred to as the TAR package, and the tar package file commands are usually terminated with. Tar. After the tar package is generated, it can be compressed with other programs, so
how to unzip a. gz zip file
#gzip-D xxx.gz
Tar command
[Root@linux ~]# tar [-cxtzjvfppn] files and directories ....
Parameters:
-C: Create a compressed file parameter directive (the meaning of Create);
-X: Unlocks a parameter directive for a
Compression ratios are different for each compression algorithmGZIP: Compressed files are. gz format, so is the suffixGzip/path/to/somefile: The original file is deleted when the compression is complete, the compressed file is named after the source
Copy CodeThe code is as follows:
Class zip
{
var $datasec, $ctrl _dir = Array ();
var $eof _ctrl_dir = "\x50\x4b\x05\x06\x00\x00\x00\x00";
var $old _offset = 0; var $dirs = Array (".");
function get_list ($zip _name)
{
$zip = @fopen ($zip _name, '
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.