bin2003
asked on
Extract a folder from a tgz file
I have a backup of my sever each night that creates a tgz file. In the file are many folders with many files. I wish to just extract one particular folder (it has thousands of text and pdf files in it ).
What is the syntax to extract just a folder of files and put it back in the correct place?
Thank you
What is the syntax to extract just a folder of files and put it back in the correct place?
Thank you
ASKER
Thank you. How does this know which folder to extract to? Do I have to extract to folder where I have the tgz file then copy/move them to correct folder afterwards?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just do:
cd /
tar zxvf /path/to/backup.tgz path/to/folder/to/be/resto red
cd /
tar zxvf /path/to/backup.tgz path/to/folder/to/be/resto
You can then use the file in the extraction process by specifying the --from-file= parameter:
tar -zxvf --from-file=myfileselectio