2013-08-22 03:34:11 +02:00
|
|
|
# To extract an uncompressed archive:
|
2013-08-11 21:37:11 +02:00
|
|
|
tar -xvf /path/to/foo.tar
|
|
|
|
|
2013-08-22 03:34:11 +02:00
|
|
|
# To create an uncompressed archive:
|
2013-08-18 16:31:09 +02:00
|
|
|
tar -cvf /path/to/foo.tar /path/to/foo/
|
|
|
|
|
2013-08-22 03:34:11 +02:00
|
|
|
# To extract a .gz archive:
|
2013-08-11 21:37:11 +02:00
|
|
|
tar -xzvf /path/to/foo.tgz
|
|
|
|
|
2013-08-22 03:34:11 +02:00
|
|
|
# To create a .gz archive:
|
2013-08-11 21:37:11 +02:00
|
|
|
tar -czvf /path/to/foo.tgz /path/to/foo/
|
|
|
|
|
2013-09-14 15:48:57 +02:00
|
|
|
# To list the content of an .gz archive:
|
|
|
|
tar -ztvf /path/to/foo.tgz
|
|
|
|
|
2013-08-22 03:34:11 +02:00
|
|
|
# To extract a .bz2 archive:
|
2013-08-11 21:37:11 +02:00
|
|
|
tar -xjvf /path/to/foo.tgz
|
|
|
|
|
2013-08-22 03:34:11 +02:00
|
|
|
# To create a .bz2 archive:
|
2013-08-11 21:37:11 +02:00
|
|
|
tar -cjvf /path/to/foo.tgz /path/to/foo/
|
2013-09-14 15:48:57 +02:00
|
|
|
|
2017-03-09 11:50:36 +01:00
|
|
|
# To extract a .tar in specified Directory:
|
|
|
|
tar -xvf /path/to/foo.tar -C /path/to/destination/
|
|
|
|
|
2013-09-14 15:48:57 +02:00
|
|
|
# To list the content of an .bz2 archive:
|
|
|
|
tar -jtvf /path/to/foo.tgz
|
2014-02-15 19:46:46 +01:00
|
|
|
|
|
|
|
# To create a .gz archive and exclude all jpg,gif,... from the tgz
|
|
|
|
tar czvf /path/to/foo.tgz --exclude=\*.{jpg,gif,png,wmv,flv,tar.gz,zip} /path/to/foo/
|
2015-09-04 10:06:37 +02:00
|
|
|
|
|
|
|
# To use parallel (multi-threaded) implementation of compression algorithms:
|
|
|
|
tar -z ... -> tar -Ipigz ...
|
|
|
|
tar -j ... -> tar -Ipbzip2 ...
|
|
|
|
tar -J ... -> tar -Ipixz ...
|