Compression packages that do not contain path information under Linux

Source: Internet
Author: User

Suitable for some file export, but do not want users to know the requirements of file storage path information on the server.

"Tar article"

Use commands directly under Linux

Tar jcvf file.tar.bz files

When compressing the files directory, if the current files path is under/home/www/files, the compressed file.tar.bz2 will contain the absolute path of files;

Solutions

Tar jcvf file.tar.bz2-c/home/www files

After this compression, it is possible to properly a relative path of the compression package, directly remove the/home/www path is not compressed.

Tar in the Unix/linux world although popular, but in the end user side, the ZIP format is still absolute mainstream, so, it may be more useful in the ZIP format.

"Zip article"

Use the-J parameter: Do not process the directory path of the compressed file

ZIP-QJ File.zip/home/www/files


Compression packages that do not contain path information under Linux

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.