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.