The tar command in Linux system packs files, and several different files are collected in the same file, which is similar to the function of compression software. Here's how to use the tar command correctly under Linux.
tar [-cxtzjvfpPN] files and directories
-c: to create a compressed file -x: unlock a compressed file -t: what file name to view the compressed files are < Br>
-j : Compress or decompress with bzip2, the file name is *.tar.bz2.
-z : Compress or decompress with gzip, the file name is *.tar.gz
-v : Display file name during compression
-f : The name of the file to be processed after the solution can only be placed at the end of the parameter
-p : use the original The original attribute of the file (the attribute does not change depending on the user)
-P : Keep the absolute path
-N : newer than the following date (yyyy/mm/dd) Will be packaged into the newly created file!
First, compression, decompression, query
Compression: tar -zcvf filename.tar.gz File or directory name to be compressed
Query: tar -ztvf filename .tar.gz
Unzip: tar -zxvf filename.targz -C directory you want to compress
Second, add files to the archive
to existing ones Add files to the archive file, append options -r
tar-rvf original.tar new filename
Third, splicing two compressed files
Combining multiple with -A option Tar file
tar -Af file1.tar file2.tar
IV. Excluding some files in the archive file
Excluding files matching wildcards with --exclude[PATTETN]
Excluding all .txt files
tar -cf xiao.tar* --exclude “*.txt“
The above is the correct use of the tar command under Linux. The method, it should be noted that the file formed by packing with the tar file is not a compressed file, so it cannot be opened with compression software. For more information on how to use the tar command, you can click on the summary of the tar command in the Linux system.
After the Linux system has been in operation for a long time, it will generate a lo
The Vi editor is a text editor for Linux. It is widely used in Linux systems. Many friends have prom
Use the cp command to copy files on Linux systems, but when you use the cp command
When using rsync to transfer large files, Linux system cannot guarantee the complet
How to solve the difference in the used space detected by the Linux df and du commands?
How to configure Nginx under Linux to restrict website users to use proxy IP access
Ubuntu configuration steps using OpenDNS
Common usage summary of free commands under Linux
What should I do if Linux vi is stuck?
How to use rsa password-free login in Linux
How to restart Tomcat regularly on Linux system
Linux Zsh command usage example
How to install different versions of Linux system on the same computer
Windows 7 system backup method introduction
Word2013 method of adding and deleting watermarks
Win7 64 pure version of the web page open garbled how to do it Solution Description
Three strokes and two styles of ISO image file skills gathering
Windows8 market share is twice that of Mac OS X
Close the IDE channel to improve the efficiency of windows2008
Play computer dual device: dual hard drive, dual optical drive
Windows 10 system DHCP is not assigned to the network connection limited detailed solution
Windows 8 system has a quick view method for installing .net framework