Command:
tar operation on compressed file
1. -c: create compressed file
2. -x: decompress < Br>
3. -t: View the contents
4. -r: Append the file to the end of the compressed archive
5.-u: Update the file in the original archive
These five are independent commands. One of them is used for compression and decompression. It can be used with other commands but only one of them can be used. The following parameters are optional when compressing or decompressing files as needed.
1. -z:
with gzip attribute 2. -j:
with bz2 attribute 3. -Z:
4. -v: Display all procedures
5. -O: Unpack the file to standard output
The following parameter -f is required
-f: Use the file name, remember, this parameter is the last parameter, only the file name can be followed.
1. # tar -cf all.tar *.jpg
This command will be all. The jpg file is labeled as a package called all.tar. -c indicates that a new package is generated, and -f specifies the file name of the package.
2. # tar -rf all.tar *.gif
This command will be all. The gif file is added to the all.tar package. -r means to add a file.
3.# tar -uf all.tar logo.gif
This command updates the logo.gif file in the original tarball all.tar, and -u means the update file.
4. # tar -tf all.tar
This command lists all the files in the all.tar package, -t is the meaning of the listed files
5 .# tar -xf all.tar
This command is to solve all the files in the all.tar package, -x is the meaning of unpacking
Compression
tar &ndash ;cvf jpg.tar *.jpg //Pack all jpg files in the directory into tar.jpg
tar –czf jpg.tar.gz *.jpg //Pack all jpg files in the directory into jpg After .tar, and compress it with gzip, generate a gzip-compressed package named jpg.tar.gz
tar –cjf jpg.tar.bz2 *.jpg //will all the directories The jpg file is packaged into jpg.tar, and it is compressed with bzip2 to generate a bzip2 compressed package named jpg.tar.bz2
tar –cZf jpg.tar.Z *.jpg //Package all the jpg files in the directory into jpg.tar, and compress them with compress to generate a umcompress compressed package named jpg.tar.Z
rar a jpg.rar *.jpg //rar format compression, you need to download rar for linux
zip jpg .zip *.jpg //zip format compression, you need to download zip for linux
The following is a detailed decompression command, suitable for in-depth study and as a manual:
tar - c|
x|
u|
r|
t[z|
j][v] -f <archive file> [unpackaged file]
Package multiple files into one archive file, which can be compressed while being packaged. The supported formats are tar (archive), gz (compressed), bz2 (higher compression ratio, more time consuming)
-c creation
-x unpacking
-u update
-r add
-t view
-d compare files and files in compressed packages
-A Add tar files to archive
-z using gz compression format
-j Using bz2 compression format
-v Display procedure
-f <filename> Archive file name
[Unpacked file] Required to create and update
Example:
tar -czvf xxx.tar.gz xxx/xxx1 xxx2 xxx3 The files to be packaged are separated by spaces
tar -czvf xxx.tar.gz /home/user/xxx/Packaged with absolute path, unpacked also uses absolute path
tar -xzvf xxx. Tar.gz unpacked by relative path to the current directory, or unpacked by absolute path
tar -czvf xxx.tar.gz xxx |
Split -b 1m After packaging, use split to split multiple files into 1m size
Other parameters
-P When using absolute path compression, keep the root directory "/"
-W checksum
-p restore file permissions
-w ask user
--totals statistics
-T < expression > Handling Eligible Files
-X <Expressions> Excluding Eligible Files
================== =============
zip [parameters] <compressed packages> <source files>
Packaging files in zip format
-r recursively handles all files and subdirectories in the specified directory together
-S contains system and hidden files
-y directly saves the symbolic link instead of the link File
-X does not save extra file attributes
-m After compressing the file and adding it to the compressed file, delete the source file
-<compression level> 1 ~9, the higher the number, the higher the compression rate
-F Try to fix the corrupted compression
-T Check if each file in the backup file is correct
-q Do not display the instruction execution process
-g Attach the file to the existing one after compression After compressing the file, instead of creating a new compressed file
-u Updating the file inside the compressed package
-f Update the files in the compressed package. If the eligible file is not included in the compressed package, add
-$ after compression to save the volume label of the disk where the first compressed file is located
-j to save only the file name and its Content
-D does not create a directory name in the compressed file
-i <expression> When compressing the directory, only compresses the eligible files
-x < Expression> Exclude eligible files
-n <filename suffix> Exclude files with the specified file name suffix
-b <cache path> Specify temporary file directory< Br>
-d <expression> Delete the specified file from the compressed file
-t <datetime> Set the date of the compressed file to the specified date
-o The file with the latest change time in the compressed file will be used to set the change time of the compressed file to be the same as the file
-A Adjust the executable automatic decompressed file
-c Append comments to each compressed file
-z Add comments to compressed files
-k Use MS- File name in DOS compatible format.
-l When compressing a file, replace the LF character with the LF+CR character.
-ll When compressing a file, replace the LF+CR character with the LF character.
===================================================================================== File > [Files to be released in the archive]
Unzip the zip archive file
-P <Password> Password for the zip archive
-d <path> Specify the decompression path
-n Do not overwrite the original file when decompressing
-f Overwrite the original file
-o Directly overwrite without asking The original file
-u overwrites the original file and extracts the other files in the compressed file to the directory
-l displays the files contained in the compressed file
-t Check if the compressed file is correct
-z Display the compressed package comment
-Z unzip -Z is equal to executing the zipinfo command
-j Does not process the original in the compressed file Directory path
-C The file name in the compressed file is case sensitive
-L Change all file names in the compressed file to lowercase
-s will be in the file name Space conversion underline
-X preserves the original UID/GID of the file when decompressing >
-q Does not display any information when executed
-v Display detailed information when executing
-c Display the decompressed results on the screen and make appropriate characters Conversion
-p Similar to the -c parameter, will display the decompressed result to the screen, but will not perform any conversion
-a Perform the necessary character conversion on the text file
-b Do not perform character conversion on text files
First find the iptables file Generally under /etc/sysconfig Then vi iptables Just like add
Today, Xiaobian is a beginner Linux developer to explain how to install Linux. Here Xiaobian
This article address: http://www.cnblogs.com/archimedes/p/bash-shell1.html, please indicate the sour
Under ubuntu bower reported EACCES: permissiondenied solution, used ower express to use bow
About multithreading under Linux
Ubuntu decompression command detailed
Linux virtual machine three networking modes and remote login management
Using git and github on Linux VM
Linux remote synchronization data tool rsync
Real-time automatic backup of switch configuration files every day with Linux server
Vim repair, telnet installation start, linux update software source
Vim common commands and configurations
Linux ITDB+LDAP implements the functions that ITDB imports into LDAP users
Linux using tcpdump to achieve automatic capture of 24 hours
How does WinXP completely release the network speed? Method of releasing the speed of the network
Win7 lost MSVCP100.dll caused the program can not start the solution
Language Pack (MUI) for Vista System Download
Storm video playback video image flower screen
How does the Windows 7 system turn off security alerts?
Win7 blue screen error code 0x000000c2 how to do
Win10 store purchase application prompt "Please try again later" how to do
Win7 system IE does not respond how to solve
Win10 method for setting file permissions
Win7 system N card, A card HD hard solution playback optimal settings