LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   extract files from tar file containing sub directories . (https://www.linuxquestions.org/questions/linux-software-2/extract-files-from-tar-file-containing-sub-directories-943035/)

deepa.y 05-03-2012 02:12 AM

extract files from tar file containing sub directories .
 
Hi,
I need to extract files out from a tar file containing subdirectories in to another directory.
if my tar file is mytar.tar in path /tmp/usr/mytar.tar and mytar.tar contains sub directories
m1,m2,m3 containing two files each.
i need to extract all the 6 files into
/tmp without subdirectory structure.
Please let me know how can i achieve this using pax command.

TB0ne 05-03-2012 07:37 PM

Quote:

Originally Posted by deepa.y (Post 4669082)
Hi,
I need to extract files out from a tar file containing subdirectories in to another directory. if my tar file is mytar.tar in path /tmp/usr/mytar.tar and mytar.tar contains sub directories m1,m2,m3 containing two files each. i need to extract all the 6 files into /tmp without subdirectory structure.
Please let me know how can i achieve this using pax command.

You can start by reading the man page on the pax command and/or the tar command. Reading the documentation is always a good step-one.
Code:

pax -v -r -s '/.*\///p'

John VV 05-03-2012 07:45 PM

sounds and smells like homework


All times are GMT -5. The time now is 12:19 AM.