Possible Duplicate:
tar – extract discarding directory structure
I have a tar file that include sub-directories each has several files. I need to extract all those files into one directory. Any help?
Possible Duplicate:
tar – extract discarding directory structure
I have a tar file that include sub-directories each has several files. I need to extract all those files into one directory. Any help?
Operating system not stated. Assuming some *nix-like variant.
Assuming TAR file tarfile.tar in the current directory:
mkdir temp dirwithfiles
tar xvf tarfile.tar -C temp
find temp -type f -exec mv -i {} dirwithfiles \;
rm -r temp
This will extract the full directory structure, then move all files within to the dirwithfiles directory.
Note mv -i since there might be several files with the same filename that need to be selected from.