Tar archive won't unpack – "Path contains '..'"
--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Melt
--
Chapters
00:00 Tar Archive Won'T Unpack – &Quot;Path Contains '..'&Quot;
00:28 Accepted Answer Score 18
01:17 Answer 2 Score 0
01:31 Thank you
--
Full question
https://superuser.com/questions/852589/t...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#tar #osxyosemite
#avk47
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Melt
--
Chapters
00:00 Tar Archive Won'T Unpack – &Quot;Path Contains '..'&Quot;
00:28 Accepted Answer Score 18
01:17 Answer 2 Score 0
01:31 Thank you
--
Full question
https://superuser.com/questions/852589/t...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#tar #osxyosemite
#avk47
ACCEPTED ANSWER
Score 18
You'll want to add the P
(or -P
) flag to your command line. From the manpage:
-P Preserve pathnames. By default, absolute pathnames (those that begin with a / character have the leading slash removed both when creating archives and extracting from them. Also, tar will refuse to extract archive entries whose pathnames contain .. or whose target directory would be altered by a symlink. This option suppresses these behaviors.
Try tar Pxvf 2014-12-12\ 04-00-01.tar
. Note that you'll need write access to the parent directory of the working directory where you invoke the command.
ANSWER 2
Score 0
You could try:
mkdir ./dir
tar xvf 2014-12-12\ 04-00-01.tar -C --./dir