28 Feb 2014

Archive and extract files in Linux

Compression
To create a tar containing "files":
tar cf file.tar files

To create a tar with Gzip compression:
tar czf file.tar.gz files

To create a tar with Bzip2 compression:
tar cjf file.tar.bz2 files

Extraction
To extract files from tar:
tar xf file.tar

To extract files from tar using Gzip:
tar xzf file.tar.gz

To extract files from tar using Bzip2:
tar xjf file.tar.bz2

0 comments:

Post a Comment