compressed file is complete. -V displays the file name and compression ratio for each compressed and decompressed file. -Num uses the specified numeric num to adjust the compression speed.-1 or -- fast indicates the fastest compression method (low compression ratio), and-9 or -- best indicates the slowest compression method (high compression ratio ). The default
Previously wrote a log file (TXT file) to extract a specific log, written to the MySQL database script, because the log is too large, maintenance staff to pack the log compressed into the tar.gz format.
TXT file before a single file of more than 2G, a single TXT
1.spark Read the compressed file of HDFs GZ
spark1.5 later versions support direct reading of files in GZ format, no difference from reading other plain text files.Start the spark shell interface and read the GZ file in the same way as a plain text
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 compressed file.
-T: View the files inside the tarfile.
In particular, th
. tar.gz and. gz files are two different files that need to be treated differently, and of course the decompression commands are different, so let's share their respective decompression methods.
1.. tar.gz file, which is a compressed file of the tar file, can be decompressed using the tar command .
For example:
The xxxx.tar.gz file uses tar with ZXVF parameters and can be unpacked at once. XXXX is the filename. For example:
$tar ZXVF xxxx.tar.gz
Gzip-d Syntax: gzip [-acdfhllnnqrtvv][-s Supplemental NOTE: gzip is a widely used compression program, the file after it compressed, The extension of ". Gz" will be appended to the name. Parameter: -A or--ASCII uses ASCI
. rpm/extract Rpm2cpio file.rpm | Cpio-div. Deb/install Dpkg-i File.deb. deb/exrtact Dpkg-deb-fsys-tarfile File.deb | Tar xvf-AR P file.deb data.tar.gz | Tar Xvzf-. zip Unzip File.zip Bzip2-d myfile.tar.bz2 | Tar xvf Tar Xvfz myfile.tar.bz2 X is decompressionV is a complex outputF is the specified fileZ GZ format Gzipgzip[option] File n
such as file jdk-7u80-linux-x64.gzTo view file types:File jdk-7u80-linux-x64.gzJdk-7u80-linux-x64.gz:gzip compressed data, from Unix, last Modified:sat Apr 11 11:12:15 2015Can see that the gzip file typeExtractgzip-d jdk-7u80-linux-x64.gz # Extracted here after the production jdk-7u80-linux-x64, and removed the jdk-7u8
Tags: OS uses file data on C Linux database sqlThis is because Python uses the MYSQLDB module to interact with the MySQL database with a place to place the staged data as the cache, But the user who invokes the Python interpreter (often a server such as the Apache WWW user) has no access to the location that the cache points to.There are many ways to solve this problem.Create a folder and give the folder the permissions of the user W (not sure which u
Java extract zip-Multiple files (including folders), as follows:
Compress multiple files and folders to extract complex file directories.
The compression method uses a variable parameter that compresses 1 to many files ... Can write an array of ways or write to the parameter list ...
Zipfiles (Zip, "abc", New File
Webpack 3.8.1 failed to extract CSS using Extract-text-webpack-plugin 3.0.2, error: ERROR in./src/static/style/localtime.css Module parse failed:unexpected token (1:0) your may need an appropriate loader T o Handle this file type. |. localtimebox {| color:red; |} @./node_modules/style-loader!. /src/static/style/localtime.css 4:14-42Webpack-build.config.js is conf
Copy the Code code as follows:
/*********************** @file-path to zip file* @destination-destination directory for unzipped files*/function Unzip_file ($file, $destination) {Create Object$zip = new Ziparchive ();Open Archiveif ($zip->open ($file)!== TRUE) {Die (' Could not open archive ');}
The following small series to show you a few PHP operation zip file instance, we can read the ZIP package in the specified file and delete the specified file in the ZIP package, the following to give a big this introduction.
Extracting files from a ZIP archive
The code is as follows
Copy Code
/*PHP extracts files from zip compre
/*
PHP extracts files from zip compressed files
*/
$zip = new Ziparchive;
if ($zip->open (' jquery five screen up and down scrolling focus graph code. zip ') = = = TRUE) {//Chinese file name to use ANSI-encoded files format
$zip->extractto (' foldername ');//Extract All Files
$zip->extractto ('/my/destination/dir/', Array (' pear_item.gif ', ' testfromfile.php '));//
();
if (filename!= null filename.indexof (".")!=-1) {//is a file (file with path such as:/images/a.jpg)
Execute (zipelement,read,saverootdirectory);
}
}
catch (Exception e) {
E.printstacktrace ();
}
}
private static void execute (ZipEntry ze, inputstream read,string saverootdirectory)
Throws FileNotFoundException, IOException {
If you only read the picture, make your own decision OK.
String fileName = Z
the contents of a file to a string */public static string ReadFile (String filePath) throws IOException {StringBuffer sb = new Stringbuff ER (); Readsaztostring.readtobuffer (SB, FilePath); return sb.tostring ();}}Package com.daxiang.saztest;/** * Custom classes that use Jsoup to parse an HTM string * @author Daxiang * @date 2015-7-23 * @Description: Parse the incoming HTM with Jsoup String that writes the result of the parse to the CSV
Application ScenariosIf you need to batch parse the APK as well as the Classes.dex file in each apk file. How do you extract them? It is a viable option to change the APK name to a. zip file and extract the Classes.dex file from e
-fn.aviPackaged storage for Xvid-fn.avi, 15000k per volume (this format is popular when publishing DVDRip online)The generated file name is Test.part1.rar,test.part2.rar ... (RAR 3.20 Edition)
xExample: rar x test.rar-x *.txtExtract documents except *.txt in Test.rarX@
Y all actions are answered yesFor example, sometimes every time you extract the same file to as
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.