When running the command:
tar -xvf archive.tar.gz
The following message is printed out next to the file names:
Path contains '..'
This is caused by pathnames of the files in the archive that contain a leading
From the tar documentation:
Tar will refuse to extract archive entries whose pathnames containTar Documentation
'..'or whose target directory would be altered by a symlink
The way to solve this is to change the way you are archiving the files.
If you have an archive command like this:
tar czvf archive.tar.gz ../myFolder/myFile.docx
Then you will get the
Path contains '..' error because the pathname contains a leading
Tar will keep the
.. in the pathname but will refuse to extract it.
To solve this you need to tell tar to change directory.
-C command to change directory for the files you want to archive and use a fullstop
. to tell tar to archive all the files if you are archiving the files in a directory.
The following command solves the problem:
tar czvf archive.tar.gz -C ../myFolder/myFile.docx .