Linux Tar command package backup vps file

  

tar is a kind of compression format, but it does not compress the file but seal it into a package; because there is no compressed file corresponding packaging speed is very fast; The VPS is used as a proxy download service. The execution efficiency of the files sent back to the country is very low, and it is much easier to use tar to compress it into a package. A

Tar command parameter There are a lot of them, I only record a few enough:

-c :create to create the parameters of the compressed file; -x : to extract the parameters of the compressed file; -z : whether to use gzip compression; -v: Display files in the process of compression; -f: Top the document name, immediately after the f file name, can not add parameters

Package:

tar -cvf /home/wwwroot/YouTube .tar /home/wwwroot/YouTube ← only packaged without compression tar –zcvf /home/wwwroot/YouTube.tar /home/wwwroot/YouTube ←gzip compression package notes: all files in the YouTube directory are compressed into YouTube.tar< Br>

Unpacking method:

If the file is located at /home/wwwroot/YouTube.tar Under .gz, extract it to the /home/wwwroot directory CD /home/wwwroot/home/youtube.tar.gz

Copyright © Windows knowledge All Rights Reserved