I use the more reliable, also relatively simple, where archiver is very powerful, support ZIP format tar format, only need to provide a path to compress the existing folder.Compression:1 varFS = require (' FS ');2 varArchiver = require (' archiver '));3 4 varOutput = Fs.createwritestream (' Archiver-unzip.zip ');5 varArchive = archiver (' Zip ');6 7Archive.on (' Error ',function(err) {8 Throwerr;9 });Ten One archive.pipe (output); A Archive.bulk
First, send the unpacking package to the Linux server:1. After downloading the. tar.gz file on the WinDOS, send it to Linux via the SFTP client such as WinSCP2. Direct download via wget command in Linux#wget [Options] []wget Common parameters:-B: Background download (default download to current directory)-O: Save the downloaded file with a custom name. The downloaded fi
This example describes how Python3 implements the archive of all files and subdirectories in the file tree to a tar compressed file. Share to everyone for your reference. The implementation method is as follows:
# Archive all files and subdirectories in a file tree to a tar
Document directory
Unzip the tar command in Linux
Find-name 'xixi. php' | xargs Perl-pi-E's | Hello | AA | G'
Find-name '*. html' | xargs Perl-pi-E's | AA | Hello | G'
Find-name '*. HTML '| xargs Perl-pi-E's | | G' (Note: It seems that only one row can be matched)
In Linux, this method is used to replace a large number of files with Trojans (JS files.
Search for the ABC. cpp
Tags: color span str Decompression compiled kernel strong compressed file col tarToday try to compile the kernel, downloaded to a tar.xz end of the compressed file, online solution is less, but still found, as follows:
$XZ-D * * *. Tar.xz
$tar-XVF ***.tar
You can see that this package is also packaged and th
Tar: create an archive file [Syntax] tar [option] tarfilefilename [command description] the file name must be followed by the-f parameter and
Tar
[Syntax] tar [option] tarfile filename
[Command description]
The
/DD) will be packaged into the newly created file!–exclude file: Do not package file in the process of compression!Example:Example one: Package all the files in the/etc directory into a/tmp/etc.tar[Root@linux ~]# tar-cvf/tmp/etc.tar/etc[Root@linux ~]# tar-zcvf/tmp/etc.tar.gz
Tar
[Syntax] tar [option] tarfile filename
[Command description]
The file name must be followed by the-f parameter and used as the last parameter;
[Parameter description]
-C. Create a new archive file;
-F specifies the file name;
-R: append an object to an archive object;
-X
1. Unzip:The software package with the tar.gz extension under Linux is a package that is packaged with a tar program and compressed with the GZIP program. To install this package, the package needs to be decompressed, the package can be decompressed using "TAR-ZXFV filename.tar.gz" , and the extracted files are in a directory named filename. Into the directory, you can see the extracted files.2. Installatio
: Newer than the following date (YYYY/MM/DD) will be packaged into the newly created file!--exclude file: Do not package file in the process of compression!Example:Example one: Package all the files in the/etc directory into a/tmp/etc.tar[Root@linux ~]# tar-cvf/tmp/etc.tar/etc[Root@linux ~]#
Use the tar command in CentOS7 to decompress the file
Linux: centos7,we often encounter compressed packages in the .gz format. This package is not an executable automatic installation package. This package is equivalent to a zip package, the installation process is the process of manually extracting, editing the configuration
backup file if the file you want to update cannot be found in the backup file. -X frees the file from the profile. 3.2 Accessibility Options: -B This option is set for the tape drive followed by a number that indicates the size of the block and the system preset is 20x512 bytes. -F uses an archive
Compression:
Tar czvf/data/backup/test.tar.gz/data/a/b/directoryExtract:
Cd/data/testTar xzvf/data/backup/test.tar.gz
The problem is, the unpacked file, inside the/data/test/data/a/b/directory
To unzip in the current directory path.
That's going to work out.
Tar czvf/data/backup/test.tar.gz/data/a/b/directoryChan
Example of how to implement tar file compression and decompression in python,
Examples of downloading and downloading tar files using python
Compressed file:
Import tarfile import OS def tar (fname): t = tarfile. open (fname + ".tar.gz", "w:
/--exclude/home/yingmu/111cn.net--EXCLUDE/HOME/YINGMU/QQIf you exclude a file, change the above directory name to an exclusion rule similar to *.gif.Example three: Extracting/tmp/etc.tar.gz files under/USR/LOCAL/SRC[Email protected] ~]# cd/usr/local/src (www.111cn.net)[Email protected] src]# tar-xzvf/tmp/etc.tar.gz# in the case of presets, we can unzip the
XZ This compression may be a lot of unfamiliar, but you can see that XZ is the absolute number of Linux default to take a compression tool.Before the XZ use has been very little, so hardly anything to mention.
I was downloading phpmyadmin when I saw this compression format, phpMyAdmin compression package XZ format incredibly smaller than 7z, which aroused my interest.The latest period of time will often hear the XZ adopted sound, such as the latest archlinux something on the use of XZ compressi
1. First look at the files in the compressed document, if you do not know the contents of the file, and then directly decompression, this is not possibleYou can view the contents of a compressed package by using the #tar-tf compressed package name2. Compress a fileTAR-ZXVF zabbix.tar.gz Zabbix-2.4.7/upgrades/dbpatches/2.2/readmeLook at the format is the decompression command, and then add the need to
To reduce the amount of space occupied by log files, in many cases we package the log files in days or weeks as tar.gz packages. While this is a good space to take advantage of, it is inconvenient when we want to look at the contents of a compressed package. If it's just a tar.gz file, unzip it, and then use grep, awk, or VI tools to view or process it. However, if there are one months or a year of log need
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.