Score:0

Extract specific file from tar.gz file?

pe flag

I am trying to extract a specific file from a tar.gz file. This is the code I used:

tar -zxvf Laura.tar.gz Laura/2021-10-22_16.52.10_pWOX5-YFP_x_membraneRed_Movie1/DC_CROPPED_h5/DC_CROPPED.h5

Laura.tar.gz is my tar.gz and DC_CROPPED.h5 is the file that I want to extract (its directory is the one that appears in the code).

Why am I not getting feedback as I run the code? I feel like verbose (-v) is not working.

I am doing all of this in Putty from windows.

Romeo Ninov avatar
in flag
Did you check that the file and path are correct? You can do it with `tar -tzvf Laura.tar.gz|grep DC_CROPPED.h5`
Marina Herrero avatar
pe flag
I just tried this and I dont get anything back. Should I wait longer?
Romeo Ninov avatar
in flag
Did you get the prompt after executing?
Marina Herrero avatar
pe flag
I did not get any propmt. However, while the tar.gz was running, i tried this: doing ctrl+z and it said it stopped and then I did bg and I also got propmt.
Romeo Ninov avatar
in flag
wait for result
Romeo Ninov avatar
in flag
and do not use Ctrl-Z, this hold the process and put it in baclground
Marina Herrero avatar
pe flag
Ive been waiting for too long and nothing happens...
Romeo Ninov avatar
in flag
Stop it with Ctrl+c. And try to run `tar -tzvf Laura.tar.gz` to see if there is other problem
fk flag
Extracting a file from a TAR can take some time - depending on the size of the TAR and your storage performance.
Score:0
gu flag

The structure of a tar file is just a long list of ${file_metadata}${file_content} so it still needs to find the specific file you're looking for in the archive, which means sifting through it. Depending on the size of the archive and the performance of the storage it's on, this can take a while.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.