back up/home,/etc, but don't/home/dmtsai
[Root@linux ~]# TAR–EXCLUDE/HOME/DMTSAI-ZCVF myfile.tar.gz/home/*/etc
Example eight: The/etc/package will be unpacked directly to the bottom of/tmp, without producing a file![Root@linux ~]# Cd/tmp[Root@linux tmp]# tar-cvf–/etc | TAR-XVF-# This action is a bit like cp-r/etc/tmp ~ still has its use!# The place to note is
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
There are many Linux compression commands. Here, let's talk about the tar command first. This command should be the most commonly used. How can this problem be solved. We will introduce the Linux compression command later to make it a series. A detailed example is provided to help you understand the situation.
[Root @
Tags: unzip gzip for tle POS representation and. GZ sizeA 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 co
Tar is the most common packaging and compression tool under Linux, which plays a role similar to WinZip or WinRAR under Windows in Linux. Here is the tool's common command parameters and application examples:Main commands:-C Create Package-X Solution Package-T list the contents of the package-R to add files to the specified package-U update files in packageOption
Tar command
[Root @ Linux ~] # 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
Tar (1) User Commands tar (1)NAMETar-manual page for tar 1.26SynopsisTar [OPTION ...] [FILE] ...DESCRIPTIONGNU ' tar ' saves many files together into a single tape or disk archive, and canRestore individual files from the archive.Note that this manual page contains just very brief description (or more like aList of pos
file!Example six: In/home, more than 2005/06/01 new files are backed up[email protected] ~]# tar-n ' 2005/06/01 '-ZCVF home.tar.gz/homeExample seven: I want to back up/home, etc, but don't/home/dmtsai[email protected] ~]# tar--exclude/home/dmtsai-zcvf myfile.tar.gz/home/*/etcExample eight: Unpack the/etc/directly under/TMP without generating files![Email protected] ~]# cd/tmp[email protected] tmp]#
/01"-ZCVF home.tar.gz/homeExample seven: I want to back up/home, etc, but don't/home/dmtsai[Email protected] ~]# tar--EXCLUDE/HOME/DMTSAI-ZCVF myfile.tar.gz/home/*/etcExample eight: Unpack the/etc/directly under/TMP without generating files![Email protected] ~]# cd/tmp[Email protected] tmp]# TAR-CVF-etc | TAR-XVF-# This action is a bit like cp-r/etc/tmp ~ still h
ExtractSyntax: tar [primary option + secondary option] file or directory
When you use this command, the main option is required, and it tells tar what to do. The auxiliary option is used for assistance and can be used.
Main options:
C. Create a new archive file. Select this option if you want to back up a directory or some files.
R: append the file to the end of
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
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
want to back up/home, etc, but don't/home/dmtsai[Email protected] ~]# tar--exclude/home/dmtsai-zcvf myfile.tar.gz/home/*/etcExample eight: Unpack the/etc/directly under/TMP without generating files![Email protected] ~]# cd/tmp[Email protected] tmp]# TAR-CVF-etc | tar-xvf-# This action is a bit like cp-r/etc/tmp ~ still has its use!Note that the output file
This article describes the basic use of the tar command, Special: Use the tar command to encrypt the file.Assume that there is a folder/stuff in the current directory.1. Pack all the files in the/stuffdirectory into A. tar file.$ Tar
specified files to a compressed package using gzip
TAR-ZXVF 1.tar.gz
Unzip the GZ compressed package to the current directory
-j Pack and use b zip 2 compress the specified file to the compressed package
TAR-JXVF 1.tar.bz2
Unzip bz2 Compress package to current directory
TAR-CJVF 1
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: With the bz2 attribute-Z: With the Compress at
TarUnpacking: Tar xvf Filename.tarPackage: Tar cvf filename.tar DirName-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 com
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: With the bz2 attribute-Z: With the Compress at
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: With the bz2 attribute-Z: With the Compress at
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.