For details about tar, gzip, and unzip commands, refer to tar to create files and directories. Using tar, you can create a file (backup file) for a specific file, change the file in the file, or add a new file to the file. Tar was originally used to create files on tape. Now, you can create files, such as floppy disks, on any device. Using the tar command, you can package a large number of files and directories into one file, which is very useful for
background: still a friend, when invoking the unzip command with PHP, there is a problem with permission being rejected again.Notice: The problem described here is to execute PHP files using the PHP command line, so the process is the owner of the user who is logged in, not the Nginx user.Log in as root to set read and Execute permissions for MyUser's home directoryNotice:CD to a directory, you need to have Execute permissions on the directory, otherw
Python's Tarfile module makes it easy to read tar archive files, and Cow B is able to handle compressed archive files using gzip and bz2 tar.gz and tar.bz2.
Corresponding to the Tarfile is the ZipFile module, ZipFile is the processing of zip compression. Note: Os.system (cmd) allows the Python script to execute commands, of course including: Tar-czf *.tar.gz *,tar-xzf *.tar.gz,unzip and so on, when I think this can solve the problem, but I feel very a
(Fi_d)ElseGlobal FileCountGlobal ZipdirFileCount = FileCount + 1# Print FileCountFileName = Os.path.join (filepath,fi_d)Filenamenoext = Getfilenameandext (FileName) [0]Fileext = Getfilenameandext (FileName) [1]# If you want to save to the same folder, set the file name to emptyFilenamenoext = ""Zipdirdest = Zipdir + "/" + Filenamenoext + "/"If fileext in ['. zip ', '. rar ']:If not Os.path.isdir (zipdirdest):Os.mkdir (Zipdirdest)if Fileext = = ". Zip": #Print str (filecount) + "--" + fileName#
ArUnpacking: 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. tgzDecompression: Tar zxvf FileName.tar.gzCompression: Tar zcvf FileName.tar.gz DirName---------------------------------------------. bz2Decompression 1:bzip2-d filename.bz2Decompression 2:BUNZIP2 filename.bz2Compression: Bzip2-z F
A detailed example of compression decompression commands under LinuxExample: compressing the contents of the current directory on the server as a xxx.zip fileZip-r xxx.zip./*Unzip the zip file to the current directoryUnzip Filename.zip============================Another: Some servers do not install the ZIP package does not execute the zip command, but basically can be used with the tar command, the example is as follows:tar-zcvf/home/zdzlibs.tar.gz/ho
ratioThe compression ratio of compressed files can be verified by using the '-l ' option.Gzip-l archieve.gzCheck the compression ratec) Unzip the fileGunzip is used to extract files, where the original (compressed) files are also deleted after being decompressed. Use the-C option to preserve the original file.Gunzip-c archieve.gzUnzip the fileGzip plus the '-d ' option and gunzip have the same effect on compressed files.More details are available fro
Tags: top production system component Ubuntu information file system compressed file UbuntRemove directory structure plus--strip-components NSuch as: Compressed file Eg.tar file information is src/src/src/eg.txtRunning TAR-XVF Eg.tar--strip-components 1Results:src/src/eg.txtIf you run TAR-XVF Eg.tar--strip-components 3The results of the decompression are: eg.txtIn the decompression, if you want to specify the decompression directory, you can add the parameter-C target directorySuch as: If we
Compression Decompression Command Introduction. GZ compression to gzip files. bz2 compression to bzip2 file. tar package files, merging multiple files into one directory. tar.gz first into a tar package, then compressed to gzip file. tar.bz2 first into a tar package, then compressed into a bzip2 file. Tar. Z first into a tar package, then compressed to Z file. rarCompress to RAR fileCompressed rar a *.rar fileUnzip Unrar e *.rar. zipCompress to zip fileCompressing zip *.zip filesDecompression
One, ". GZ" Compressed file 1 compression syntax gzip [file]2 decompression syntax gunzip [Compressed file]3 linesGzip can only compress filesGzip does not retain original filesSecond, ". bz2" Compressed file 1 compression syntaxbzip2 [-K] [file]-K Retain original file (keep) after generating compressed file2 decompression syntaxBUNZIP2 [-K] [file]-K retains the original compressed file (keep) after generating the extracted file3 descriptionBZIP2 can only compress filesIii. ". tar.gz"
Tags: Specify file Pre nbsp compression tool Save Command Value Rescommands for the common Unzip tool: gzip (. gz) bzip2 (. bz2) XZ (. xz) compress (. z) tar (. tar)1.gzipSyntax: gzip option FILECommon options:-D-#-C(1)-D decompressionDecompression method: "Gzip-d FILE"(2)-# set compression ratio, default is 6 (range value is 1-9)(3)-C compression when the source file is preserved while the compressed content is entered into the terminal, usually and
not display the instruction execution process.-R recursive processing of all files and subdirectories under the specified directory.-S contains system and hidden files.-t-T checks that each file in the backup file is correct.-U replaces the newer file with the compressed file.-V Displays the instruction execution process or display version information.-V Saves the file properties of the VMS operating system.-W in the file name if the version number, this parameter is only valid under the VMS op
This class implements the reference PHP manual comment/** * Function: Unzip file in ZIP format * author:friker * date:2015-15-14 * reference:http://php.net/manual/zh/ref.zip.php * All Rights reserved:[emailprotected] */class unzip{public Function __construct () {//init code here ... Heade R ("Content-type:text/html;charset=utf8"); /*** unzip the file to the spe
Unzip
Tar
Common Decompression Commands: TAR-ZXVPF : Unzip TAR-ZCVPF: Compression # tar [-j|-z] [CV] [-F established file name ] filename ... Packaging and Compression # tar [-j|-z] [TV] [-F established file name ] View file name # tar [-j|-z] [XV] [-F established file name ] [-C directory ] Unzip Parameters: - Z : Through gzip the s
The unzip command is used to decompress compressed package syntax compressed by zipUnzip (parameters) (option)General usage Unzip aaa.zip-d homed/extract to home directory unzip-v aaa.zip View compressed file contents Unzip-t Aaa.zip Verify that compressed files are complete options-C: Display the extracted results to
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.