Aug 7, 2011

Linix: Create/Extract tar file

Create tar.gz file



tar -cvzf mytarfile.tar.gz <directory>


this means:
-c = create new archive
-v = be verbose
-z = compress using gzip
-f = filename to create for the new archive

Extract tar.gz file



tar -xzf mytarfile.tar.gz




Create tar.bz2 file



tar -cvjf mytarfile.tar.gz <directory>


this means:
-c = create new archive
-v = be verbose
-j = compress using bzip2
-f = filename to create for the new archive


Extract tar.bz2 file



tar -xpjf file.tar.bz2

No comments: