0

I know this question was previously asked on this site before like here 1 and here 2 but no success for me.

I want to extract the Measures folder from my S012011_csv.tar.gz zipped file. If I do tar -ztvf file.tar.gz to see the content, you can see the folder directory structure:

global//scratch//chamar//data//S012011_csv/Measures/file1.csv

global//scratch//chamar//data//S012011_csv/Measures/file2.csv

and so on (yes there are //).

I only want to extract the subfolder Measures under folder S012011_csv in the current directory of the .tar.gz folder.

I have tried all these options but no success:

tar -xvzf S012011-v41_csv.tar.gz --strip=6 ./global//scratch//chamar//book//S012011-v41_csv/Mearsures/*

tar -xvzf S012011-v41_csv.tar.gz --strip=6 global//scratch//chamar//book//S012011-v41_csv/Mearsures/*

tar -xvzf S012011-v41_csv.tar.gz --strip=6 global/scratch/chamar/book/S012011-v41_csv/Mearsures/*

tar -xvzf S012011-v41_csv.tar.gz global/scratch/chamar/book/S012011-v41_csv/Mearsures/*

What am I doing wrong?

CharlesM
  • 103
  • 1
  • 4

1 Answers1

1

Try this:

tar -xvzf S012011-v41_csv.tar.gz "*S012011-v41_csv*Mearsures*"
drkblog
  • 2,665