0

I have a bzipped folder that contains files within it. The files within it are about 1TB, but I only need about 50GB of them, and if I try to get all the files in the folder, my machine runs out of memory. Here is the command I'm currently using:

pbzip2 -dvc -m1000 popularity20151223.tbz |sudo tar x

How would I only extract the file called "myfile" from the above tarball? The equivalent of this with tar is:

tar xpj -C {tarball} {files_to_unarchive}
osgx
  • 90,338
  • 53
  • 357
  • 513
David542
  • 104,438
  • 178
  • 489
  • 842

1 Answers1

2

You can do this similarly with the tar command:

pbzip2 -dcv -m1000 /Users/david/Desktop/popularity20151216.tbz
  | tar x popularity20151216/myfile1  popularity20151216/myfile2
David542
  • 104,438
  • 178
  • 489
  • 842