Extract particular folder from a .tar format files.
Hi All- I want to extract a particular folder from .tar format files.
For example: File Name: backup.tar The backup.tar contains the below folders & files. 1)/root_folder/Folder1/Folder1-1/* 2)/root_folder/Folder1/Folder1-2/* 3)/root_folder/Folder2/Folder2-1/* 4)/root_folder/Folder2/Folder2-2/* The “tar -xf” command extract 1 to 4 item. But I want to extract ‘Folder1' and their tree only ( 1 - 2 only). Please help me the command.
What Operating System and version you you have?
What Shell do you use?
Do you have the "pax" command? It's a program which can read "tar" archives.
What was the command used to create the "tar" archive?
How large is the archive, and how many different files need to be restored?
Quote:
ls -ald backup.tar
What do some sample filenames look like:
Quote:
tar -tf backup.tar
Do you know that if the archive was created with absolute pathnames you can only restore to exactly the same directory with "tar"?
Why so many questions you may ask? Restoring from a "tar" archive is inherantly dangerous.
The generic answer based on what we know so far is:
Do test the command syntax in a test server with expendable files and be aware that the target folder and subfolders will be overwritten.
@solaris040
What Operating System are you running? Do you have some sort of enhanced "tar"?
More importantly, what 'tar' do you have? For example, nothing is stopping you from running GNU tar on a Solaris-kernel system. Nothing prevents you from writing or modifying your own tar command and installing it.
I would like to confirm my file.tar is been tar-ed correctly before I remove them. But I have very limited disc space to untar it.
Can I just do the listing instead of actual extract it? Can I say confirm folder integrity if the listing is sucessful without problem?
tar tvf file1.tar
... (1 Reply)
Hi,
I have tar filw which has multiple directories which contain files.
When i extract using tar -xf the directory structure also get extracted.
I require only files and not directory structures as there will be overhead of moving the files again.
So i searched here and got a solution but... (4 Replies)
Hi,
I need backup all the files(including sub directories files ) which we modified today and create the tar file with the filename_<current_date>.tar
Thanks (1 Reply)
Hello all.
I have a tar file that contains a number of files that are stored in different directories.
If I extract this tar file with -xvf , the directories get created.
Is there a way to extract all of the files into one directory without creating the directories stored in the tar file. (9 Replies)
I am trying to grab a folder and all the folders and files underneath it and send it from one computer to another. I basically want to compress the whole folder into a tar, tgz, or zip file so that it can be sent as one file. is there a command to compress a folder and all its contents into a tar... (7 Replies)
Hi ,
I need to extarct only a particulay files from the tar.Z.
ie
i need to extract one.txt from test.tar.Z.
The test.tar.Z may contain lot of file and folders.
Please help me to extract particular file to some location.
Regards,
Kalai. (1 Reply)
I received a tar file of a directory with 50,000 files in it. Is it possible to extract the files in the tar file without first creating the directory?
ie. Doing tar -xvf filename.tar extracts as follows:
x directory/file1.txt
x directory/file2.txt
.
.
.
I would like to avoid... (4 Replies)
Hi All,
I want to extract my *.tar.gz files like below;
01.tar.gz
02.tar.gz
03.tar.gz
04.tar.gz
05.tar.gz
06.tar.gz
..
..
31.tar.gz
how can I do it by automatically using a command ??
thanks
Alice (5 Replies)
hi everyone
i have a tar file which was in AIX box. its 300mb.
i cant untar in windowsxp home. I just get an empty folder with no files when i extract. i dont get any bad header or any such error.
i am using IZARC which is a freeware. Not sure if i should try winzip or winrar.
any help (2 Replies)