Liunx DeleteDelete Folder instance: Rm-rf/var/log/httpd/access will delete the/var/log/httpd/access directory and all files and folders under it2 Delete File Usage instance: Rm-f/var/log/httpd/access.log will force the deletion of/var/log/httpd/access.log this fileLiunx tar.gz extract to the specified directory1. Compress the command:Command format: TAR-ZCVF compressed file name. tar.gz Compressed file nameYou can switch to the current directory first. Both the compressed file name and the compr
We are in the maintenance of Linux server, often encountered to view the contents of various formats of compressed files, here I picked a few common format files, record, easy to find later.1. tar format file tar tvf test.tar2, tar.gz format file TAR-ZTF test.tar.gz3, tar.bz2 format file TAR-JTF test.tar.bz24, zip format file unzip-v TEST.ZIP5 , bzip2 format file Bzip2-tv test.bz26, rar format File Note: Additional Unrar software required (yum install
+ system.getproperties (). GetProperty ("File.separator");for (int i = 0; i {Zip (out, fl[i], base + fl[i].getname ());}}Else{//Compress all files in the directoryOut.putnextentry (new Org.apache.tools.zip.ZipEntry (base));ZipEntry zipentry=new ZipEntry (base);Zipentry.setunixmode (644);//Solve Linux garbledOut.putnextentry (ZipEntry);FileInputStream in = new FileInputStream (f);int b;while ((b = In.read ())! =-1){Out.write (b);}In.close ();}}private static void
backup file.-X releases the file from the archive file.3.2 Auxiliary Options:-B This option is set for the tape drive, followed by a number to indicate the size of the chunk, with a system preset value of 20x512 bytes.-F using a profile or device, this option is usually required.-K saves the file that already exists. For example, restoring a file, encountering the same file during the restore process, does not overwrite it.-M when restoring files, set the modification time of all files to.-M cr
Gzip Command: File compressionGzip is GNU software and is the preferred compression tool for Linux systems, and the-Z option compression of the TAR Archive command also uses Gzip/gunzip to compress/unzip files.gzip Generate. gz fileGrammar:gzip [options] [File or directory ...]Parameters:-C or--stdout or--to-stdout to output compressed (decompressed) content to the standard output device and retain the original file-D or--decompress decompression-L or
#!/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
Linux Unzip the tar commandTar-zcvpf/backup/home.tar.gz/home with file attribute permission compressionTar cvpft/backup/config.tar/backup/configlist compression According to the list in the Configlist filetar-zxvpf/software/home.tar.gz with file attribute permissions decompressiontar [-cxtzjvfppn] files and directories ....Parameters:-C: Create a compressed file parameter directive (the meaning of Create);-x: Unlock the parameter instructions for a co
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 jpg.tar.Z *.jpg //将目录里所有jpg文件打包成jpg.tar后,并且将其用compress压缩,生成一个umcompress压缩过的包,命名为jpg.tar.Zra
Command name: zipFunction Description: Compress the file.Syntax:zip [-acddffghjjkllmoqrstuvvwxyz$][-b >][-ll][-n >][-t >][- >][Compressed Files [file ...] [-i >][-x ;] Note:zip is a widely used compression program that compresses files that have a ". zip" extension. Parameters-A adjusts the executable auto-unzip file.-b> Specifies the directory where files are temporarily stored. -C adds a comment to each compressed file.-d deletes the specifie
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
Tags: adjust load. gz different CAL host defaults let tar? ? After compressing files to improve data transmission efficiency, reduce transmission bandwidth, management of backup data has a very important function, so file compression decompression skills become the necessary skills. Compared to the file decompression tool in Windows Flowers Zhengyan, the Unzip tool in Linux is much less, the commonly used decompression commands are gzip,bzip2,tar,zip
Unable to extract zip file under Linux folder using unzipSo want to build a shell file under win to run under Linux, the result of this SH file in Linux runtime error, the same file generated under Linux can be executed.It seems that win under the file format sh suffix can not be run under Linux, win under the encoding mode of UTF8, press to Linux is also UTF8. I can't run this without a specific test.Do you want to use the vi file name to edit the composition of the command combination of the w
Decompression sequenceExample 1: The left value must be the same as the value on the right one by one, or it will be an error1 >>> a,b,c={1,2,3} #a =1,b=2,c=32 >>> a3 14 >>> b5 26 >>> C7 3Example 2: The left value must be the same as the value on the right one by one, or it will be an error1>>> a,b,c,d,e='Hello' #decompression sequence, the left value must be the right value is one by one corresponding to the relationship, or will error2>>>a3 'h'4>>>b5 'e'6>>>C7 'L'8>>>D9 'L'Ten>>>e One 'o'Ex
1. See http://www.codeproject.com/KB/files/zip_utils.aspx
2. Include the header file # include "Zip. H", # include "Unzip. H", which is already detailed in the original article.
3. It is emphasized that the number of bytes must be increased by 1 when extracting data to the memory.
Hzip Hz = openzip (filename, 0); // read the zip package
Ze. unc_size is the size of the file, so you must add one more byte to the end. Otherwise, garbled characters may o
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.