The TAR command creates archives (backups) of files and directories for Linux. With this command, you can create a backup for a specific file, or you can change the file or add a new file to it, and you can package a whole bunch of files and directories into a single file, which is useful for backing up files or merging several files into a file for network trans
Linux tar command-general Linux technology-Linux technology and application information. The following is a detailed description. Tar [-cxtzjvfpPN] file and directory ....
Parameters:
-C: create a parameter command for the compressed file );
-X: Unlock the parameter command
Tar command
[[email protected] ~]# tar [-cxtzjvfppn] files and folders ....Number of references:-C: Create an instruction for a compressed file (the meaning of Create);-x: Unlock the parameters of a compressed file!-T: View the files inside the Tarfile!In particular, the c/x/t can only exist in the release of the number of participants! Do not exist
Packing the compressed directory is very simple as follows
The code is as follows
Copy Code
TAR-CZF small.tar.gz Small (directory name), compressing and packaging catalogs
More examples
The code is as follows
Copy Code
Example one: Pack all the files in the/etc directory into/tmp/etc.tar[Root@linux ~]# tar-cvf/tmp/etc.tar/etc [Root@linux ~]
tar [-cxtzjvfppn] files and directories ....Parameters:-C: Create a compressed file parameter instruction (create meaning);-x: Unlock a parameter command for a compressed file!-T: View the files inside the Tarfile!In particular, in the release of the parameters, c/x/t can only exist one! Not exist at the same time!Because it is not possible to compress and decompress at the same time.-Z: Do you have
tar [-cxtzjvfppn] files and directories ....
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/etc [Root@linux ~]# tar-jcvf/tmp/etc.tar.bz2/etc # Note that the file name after the parameter F is taken by
following example, the user creates a file on the floppy disk of the/DEV/FDO device and copies all the files in the Mydir directory to the file.
#tar Cf/dev/fdo Mydir
To recover files on a device disk, use the XF option:
#tar Xf/dev/fdo
If you are backing up a file that is larger than the device's available storage, such as a floppy disk, you can create a tar
Tar [-cxtzjvfppn] file and directory ....Parameters:-C: Create a parameter command for the compressed file );-X: Unlock the parameter command of a compressed file!-T: view the files in the tarfile!Note that C/X/T can only exist under the parameter! Cannot exist at the same time!Because it is impossible to simultaneously compress and decompress.-Z: does it have th
Tar commandtar [-cxtzjvfppn] files and directories ....Parameters:-C: Create a compressed file parameter directive (the meaning of Create);-x: Unlock the parameter instructions for a compressed file!-T: View the files inside the Tarfile!In particular, in the release of the parameters, c/x/t can only exist one! Cannot exist at the same time!Because it is not possible to compress and decompress simultaneously.-Z: Do you have the properties of
tar [-cxtzjvfppn] files and directories ....Parameters:-C: Create a compressed file parameter directive (the meaning of Create);-x: Unlock the parameter instructions for a compressed file!-T: View the files inside the Tarfile!In particular, in the release of the parameters, c/x/t can only exist one! Cannot exist at the same time!Because it is not possible to compress and decompress simultaneously.-Z: Do you have the properties of
file Compression decompression command tar :1. Tar command-line options
Options
Command description
-C
Create a compressed archive
-X
Extract
--delete
Deletes an existing file from a compressed packa
The tar command is an uncompressed command in Linux. There are two concepts to be clear before using the tar command : packaging and compression. Packaging refers to a large number of files or directories into a total file, compression is a large file through some compressio
Linux Unzip the tar commandTar-zcvpf/backup/home.tar.gz/home with file attribute permission compressionTar cvpft/backup/config.tar/backup/configlist compression According to the list in the Configlist filetar-zxvpf/software/home.tar.gz with file attribute permissions decompressiontar [-cxtzjvfppn] files and directories ....Parameters:-C: Create a compressed file parameter directive (the meaning of Create);-x: Unlock the parameter instructions for a co
tar [-cxtzjvfppn] files and directoriesParameters:-C: Create a compressed file parameter directive (the meaning of Create);-x: Unlock the parameter instructions for a compressed file!-T: View the files inside the Tarfile!In particular, in the release of the parameters, c/x/t can only exist one! Cannot exist at the same time!Because it is not possible to compress and decompress simultaneously.-Z: Do you have the properties of
Detailed description of the TAR decompression command-C: Create compressed archives-X: Unzip-T: View content-r: Append files to the end of a compressed archive file-U: Update files in original compressed packageThese five are stand-alone commands, which use one of the compression decompression, and can be used with other commands but only one. The following parameters are optional when compressing or extrac
tar command
[Root@linux ~]# tar [-cxtzjvfppn] files and directories ....Parameters:-C: Create a compressed file parameter instruction (create meaning);-X: Unlocks a parameter directive for a compressed file.-T: View the files inside the tarfile.In particular, it is noted that c/x/t can only exist in the release of a parameter. Cannot exist at the same time.Becau
A detailed description of the TAR compression decompression command under LinuxTar-C: Create compressed archives-X: Unzip-T: View content-r: Append files to the end of a compressed archive file-U: Update files in original compressed packageThese five are stand-alone commands, which use one of the compression decompression, and can be used with other commands but only one. The following parameters are option
A detailed description of the TAR compression decompression command under LinuxTar-C: Create compressed archives-X: Unzip-T: View content-r: Append files to the end of a compressed archive file-U: Update files in original compressed packageThese five are stand-alone commands, which use one of the compression decompression, and can be used with other commands but only one. The following parameters are option
[emailprotected] ~]# tar [-cxtzjvfppn] files and directories .... parameter: -C: Create a parameter directive for a compressed file (the meaning of Create); -x: Unpack the parameter instructions for a compressed file! -T: View the files inside the Tarfile! The special note that in the release of the parameter, c/x/t can only exist one! Cannot exist at the same time! because it is not possible to compress and decompress simultaneously. -Z: Do
Tar-C: Create compressed archives-X: Unzip-T: View content-r: Append files to the end of a compressed archive file-U: Update files in original compressed packageThese five are stand-alone commands, which use one of the compression decompression, and can be used with other commands but only one. The following parameters are optional when compressing or extracting files as needed.-Z: With gzip properties-j: W
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.