list all the files in the All.tar package,-T is to list the meaning of the fileThis command is to solve all the files in the All.tar package,-X is the meaningCompressiontar –cvf jpg.tar *.jpg //将目录里所有jpg文件打包成tar.jpgtar –czf jpg.tar.gz *.jpg //将目录里所有jpg文件打包成jpg.tar后,并且将其用gzip压缩,生成一个gzip压缩过的包,命名为jpg.tar.gztar –cjf jpg.tar.bz2 *.jpg //将目录里所有jpg文件打包成jpg.tar后,并且将其用bzip2压缩,生成一个bzip2压缩过的包,命名为jpg.tar.bz2tar –cZf j
This is a creation in
Article, where the information may have evolved or changed.
Learn a little go src every day.
Today learned the simple use of the ZIP package, the implementation of the compression and decompression with the directory.
Wrote two methods, the implementation of compression, decompression.
Package Ziptestimport ("Archive/zip" "IO" "OS" "strings")//Compressed file//files file array, can be
Compression Decompression Command:compression format: gz,bz2,xz,zip,zCompression algorithm: Different algorithms, compression ratios will also be different:Compress::filename. ZUncompressCurrently the most popular compression tools:gzip:. GZ only files can be compressedgzip/path/to/somefile/ Delete source files after compression- D also means decompression-# : [1-9], Specify the compression ratio, which is
The commonly used compression commands are:. zip. gz. bz2. tar.gz. tar.bz2The. zip format can be interoperable in Linux and Windows:Zip compressed filename Original file name: Compressed file.Zip-r compressed Directory name Directory name: Compressed directory.Unzip compressed
#!/usr/bin/env python#-*-coding:utf-8-*- fromZipFileImport*ImportZipFile#Unzip the zip filedefunzip (): Source_zip="C:\\update\\sw_servers_20120815.zip"Target_dir="c:\\update\\"Myzip=ZipFile (source_zip) myfilelist=myzip.namelist () forNameinchMyfilelist:f_handle=open (Target_dir+name,"WB") F_handle.write (myzip.read (name)) F_handle.close () myzip.close ()#add a file to an existing ZIP packagedefAddzip (): F= ZipFile. ZipFile ('Archive.zip','W', Zip
REM mkdir C:\buildMD c:\buildREM Mount the Windows share to Z DriveNET use x: \\172.16.10.240\Infa_Shared\Infa_Build\Mercury\AT_build\WindowsREM Start unzip Windows build to local machine, no need to copyX:for/f "delims=|"%%i In (' DIR ' * * "/b/o:d ') do SET newest=%%iStart winrar x%newest% c:\buildKnowledge Points:1. REM is the bat annotation2. Basic commands such as MD copy del3. NET use maps shared path to disk4. Start WinRAR x%newest% c:\build wi
default, no additional installation required)2, the external network on the machine to get the parameters on the job, you can use the parameters of batch processing to find decompression3, the local Jenkins processing good packaging site files, through the Jenkins-cli.jar remote callJava-jar jenkins-cli.jar-s http://192.168.199.2:10000/build test-p buildid=1--username Administrator-- PasswordD AdminThe above means: Build test project, passed buildid
---------------------------------------------Tar command:-V Visualization-C New Package-F Specify the file name (unless you use the default user name)-X Decompression Target.tar-R Add File to Target.tar-t lists files in Target.tar-U update file files in Target.tar-Z Call gzip-j Call bzip2Compression TAR:TAR-CF [Target.tar] [file]Decompression TAR:TAR-XF [Target.tar]Compression TAR.GZ:TAR-CZF [target.tar.gz]
Gunzip-r Hongchangfirst/dataHow do I recursively delete those remaining non-log-terminated files?List the confirmation first:Find Hongchangfirst/data-type F! -name "*.log"Then really delete:Find Hongchangfirst/data-type F! -name "*.log"-exec rm-f {} \;Remember the back-exec must add a space, otherwise there will be find:missing argument to '-exec ' error.How do I merge the contents of all the files in a dir
Download the file flow: Server-side work:-------------------------------------------The client's browser sends a request to the PHP file to process the download.Note: Any operation needs to be written to memory first, whether it is video, audio, or text files, which need to be written into memory first.In other words, it is necessary to read the file on the "server" into the memory of "server" (Note: Here I add the server three words with double quo
$currentdir;/current directory
public $filename;//File name
public $fileinfo;//To save all file names and directory names and file sizes under the current directory
Public Function __construct () {
$this-GT;CURRENTDIR=GETCWD ();//Return to current directory
}
Traverse Directory
Public Function Scandir ($filepath) {
if (Is_dir ($filepath)) {
$arr =scandir ($filepath);
foreach ($arr as $k => $v) {
$this->fileinfo[$v][]= $this->getfilesize ($v);
}
}else {
echo "";
}
}
/**
* Retur
Getnextentry () to get the next compression entry.
"Example 10-13" enters several file names, compresses all files to "Ep10_13.zip", and then extracts and displays them from the compressed file.Ep10_13.java **********Import java.io.*;Import java.util.*;Import java.util.zip.*;Class ep10_13{public static void Main (String args[]) throws ioexception{FileOutputStream a=new FileOutputStream ("Ep10_13.zip");Work
store (no compression) and deflate Compression Method(Store (non-compressed) and deflate compression methods are supported-not quite clear)
Create or extract files from split ZIP files (ex: z01, z02,....zip)(Create and Extract files for multipart ZIP files)
Supports Unico
We bought a game on the market, and seldom saw a bunch of BMP and PCX resource images in the game directory. Don't they use files like BMP as image resources? They actually package and compress these resource images.
Here are a few examples of Games. The mix file of the famous mongowood "Red Guard" is a compressed package that contains a pile of game images, sounds, and other resources. There are also the.
program, but it seems that there are not as many people using compress as gzip and Bzip2 .. The file ending with Z is the result of Bzip2 compression. The decompress program relative to compress is uncompress. Use the-Z parameter in tar to call compress. The following is an example:
# Tar-CZF all.tar. z *. jpg
Forbidden. Z
# Tar-xzf all.tar. Z
This command is used to unbind the generated package. You should be able to uncompress multiple types of compressed
Create encrypted compressed files under Linux
Method One:* 1. Create an encrypted zip file using the zip command:* 2. When extracting encrypted files, you will be prompted to enter your password:
Method Two:* 1. Create a ZIP file using 7z:* 2. Unzip the encrypted file:
Method Three:* 1.To Create a encr
ZhangchangchangIn order to obtain a compressed package of files, and the package may contain compressed packets, folders, folders containing compressed packets, files and other nested cases, the use of breadth-first traversal and depth-first traversal method to solve the pro
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.