files, important parameters-P: (uppercase P) retains absolute path, allowing the backup data to contain the root directory exists--exclude=file: During compression, do not package FILETip: How to extract a single file within a packageTar-jtv-f directory/file name. tar.bz2 | grep ' Find the string 'grep is the ability to search for keywords after locating the tar
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
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
This article mainly introduces the example of using tarfile to compress and decompress the tar archive file in Python. This article provides examples of decompressing and compressing the code directly. if you need it, refer to the example below.
The zipfile module corresponds to the tarfile, and the zipfile process zip compression. Note: OS. system (cmd) allows Python scripts to execute commands, including
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
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
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
/--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
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.