Tar parameter, tar

Source: Internet
Author: User

Tar parameter, tar

Parameters:

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 file. For example, if you have prepared a backup file and find that there is still a directory or some files have forgotten to be backed up, you can use this option to append the directory or files you have forgotten to the backup file.

T list the file content and check which files have been backed up.

U updates the file. That is to say, replace the original backup file with the new file. If the file to be updated cannot be found in the backup file, append it to the end of the backup file.

X release a file from the file.

Auxiliary options:

B. This option is set for the tape drive. It is followed by a number to describe the block size. The default value is 20 (20*512 bytes ).

F. This option is usually required when you use an archive file or device.

K. Save the existing files. For example, if we restore a file, the same file will not be overwritten during restoration.

M sets the modification time of all files to the present when restoring files.

M creates a multi-volume archive file to store it on several disks.

V detailed report on the file information processed by tar. If this option is not available, tar does not report file information.

W each step requires confirmation.

Z uses gzip to compress/decompress the file. With this option, the file can be compressed. However, you must use this option to decompress the file during restoration.

 


Question about tar command parameter f and C in linux

# Man tar
-C, -- directory DIR
Change to directory DIR
-C is the target directory for extraction and change. The default directory is the current directory. Tar vxfj/mnt/hgfs/linux/xxx.tar.bz2-C/is extracted to the root directory

-The f parameter can be compressed and decompressed without having to immediately follow the file name.
Such as tar jvfc xxx.tar.bz2 xxx.

What is tar-v? What is the V parameter?

The lower-case-v command is used to allow the tar command to output more prompts. For example, after-v is added, the name of the packaged file will be output during packaging.

The uppercase-V usage is

-V label-name

The role is to add a label to the prepared package, for example
Tar-V ppp-cf my.tar test/
Package the testobject to my.tar, And the label of the package is ppp.

This method is useless for general computers, mainly for packaging to a tape drive (tape) (according to the official gnu tar Statement)

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.