Linux backup and compression tool Tar instructions

Source: Internet
Author: User
Article Title: Linux backup and compression tool Tar instructions for use. Linux is a technology channel of the IT lab in China. It includes some basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source. Because tar is very useful, there are many other functions besides backup, so here we will make some comments on it. For more details, see man tar ).
 
Tar is an archive program, that is, tar can combine many files into a large file or write them into a backup device, such as a tape drive. After you generate such a large file, you will want to compress it. The-z option is dedicated to this. Therefore, tar provides a very good way to publish programs or software on the Internet. This method is widely used in Linux.
 
This is an example of a tar command line:
 
Tar-zcvf myfiles.tar.gz/usr/local/bin
 
Let's analyze the specific meaning of this line of command:
 
Tar
 
Command name.
 
-
 
Tell tar the following options.
 
Z
 
Tell tar to automatically use gzip compression. If you use this option, it is best to use the suffix to make. gz.
 
C
 
Tell tar to create a new file.
 
V
 
Verbose allows tar to tell you what it is doing at work.
 
F
 
This option indicates the name of the file to be created or the name of the device to be used. If/dev/st0 is used here, it will write the backup to the tape drive device/dev/st0.
 
Myfiles.tar.gz
 
This is the file name of the file to be created.
 
/Usr/local/bin
 
This is the name of the files or directories we want to archive. Here we can put more than one name, separated by spaces.
 
You will often see files such as tar.gz (or shortened to. tgz) on the Internet. You can use the following command to unwrap them:
 
Tar-zxvf filename.tar.gz
 
Tar-xjf * .tar.bz2
 
Decompress the bzip file.
 
Related Article

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.