1
vote
2answers
50 views

tar compression without directory structure

Under my current directory, I have two sub-directories: dir_1/ - file1.png - file2.png ... - fileN.png dir_2/ - fileA.txt - ... - fileZ.txt When I tar compress the two ...
1
vote
1answer
65 views

untar specific directory

tar tvf filename.tar gives me: -rwxrwxrwx 0/0 544795 2010-03-15 12:49 35 WOO WORDPRESS THEMES/bloggingstream.zip -rwxrwxrwx 0/0 1659095 2010-03-15 12:51 35 WOO WORDPRESS ...
3
votes
1answer
881 views

Extract single file from tar to other folder

I've searched for multiple forums for this questions and have seen different answers but so far, nothing have worked yet even from the ones I've seen here. I want to extract a single file from a tar ...
0
votes
1answer
205 views

Extract a single file from a tar file and put it to another directory [duplicate]

I need to extract a single file from a tar file to another directory. So far I have this: This one extracts a single file to same directory: tar -xvf filename.tar ./file.txt I tried this but it's ...
4
votes
1answer
735 views

Does tar -x Extract to Current Directory or Does it Extract to the Source of the Archive?

Does tar -x by default just extract to the current directory or does it try to reproduce the original directory structure including overwriting the original source? I know I can specify a folder to ...
3
votes
2answers
660 views

I want to tar X directory not including its parents

tar cvf /var/lib/backup/sample.tar /home/user/.project However, when I extract, I get its parents as well /backup/ - /home/ - /user/ - .project/ This tar commands does it job ...
2
votes
2answers
282 views

Untar directory from large tarball

How do I untar a directory that I don't know the path to? I only know the directory name. I know how to untar a single file with a wildcard: tar -xf somefile.tar.gz --wildcards --no-anchored ...
4
votes
1answer
3k views

Will tar -cvzf packed.tar.gz mydir take hidden files into account?

I need to create a tarball of a given directory. However, I need to make sure hidden files are included too (such as those beginning with .). Will the following command automatically take the hidden ...
26
votes
5answers
15k views

How to XZ a directory with TAR using maximum compression?

So I need to compress a directory with max compression. How can I do it with xz? I mean I will need tar too because I can't compress a directory with only xz. Is there a oneliner to produce e.g. ...
1
vote
1answer
4k views

Create target directory when extracting tarball

Is it possible to create a target directory, similar in nature to the mkdir -p switch, where I can define a non-existent target directory within my tar command, and tar will create the directory for ...