Linux Command Line notes

Source: Internet
Author: User

1. tar commandTar-CVF file2.tar/home/usr2/file2If such a command uses an absolute path, "/" is automatically removed during archiving. During decompression, home/user2/file2 will appear in your current working directory. Because/is removed, his parent directory is the current working directory.

When the relative path is used, for example, there is file1 under usr1 at home and file2 under user2. When we want to compress file2, tar-CVF file2.tar under user2 under user1 .. /user2/file2 will prompt ".. /"is removed. Only user2/file2 and home will appear in the decompressed directory.
Use the-C parameter to change the working directory, or use tar-CVF file2.tar-C .. in the example of/user2/file2, the compressed file2.tar will be under user1, but when you decompress the file, you find that only file2. because file2 is archived under user2 after changing the working directory, is an archive object relative to user2.

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.