0

I would like to change the path of extraction of a .tar.gz archive. The files are supposed to extract as ./1/2/3/4/files, ./1/2/3files and so on.

The .1/2 part of those is common to all the files.

My question is, how can I modify the extraction path to extract into ./2/ and completely ignore the 1 directory?

1
  • 2
    I assume Linux, but tagging the OS would probably be a good idea too.
    – EBGreen
    Feb 13, 2012 at 20:20

1 Answer 1

1

Generally you use the --strip-components=n option for this using gnu tar. It strips n leading directories from the paths.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .