MyTetra Share
Делитесь знаниями!
How to tar.gz
Время создания: 25.04.2013 22:02
Раздел: root - Linux
Запись: Yurons/mytetra/master/base/1366916559e0d6zvookq/text.html на raw.github.com

How to tar.gz

by Nish Vamadevan on 08/07/2006 · 0 comments

If you are in the same directory as where your files / folders are placed, then you dont have to specify the file location. i.e. /usr/home/bleh/bleh

This is how to make a .tar.gz from a Folder

tar czf /path/to/output/folder/filename.tar.gz /path/to/folder

i.e if you are in

/path/to/output/

and you want to put the file in /path/to/output/ you can use the following command.

tar czf filename.tar.gz folder

This is how to extract a .tar.gz file

gunzip -c /path/to/folder/filename.tar.gz

or like i do…

tar -zxvf /path/to/folder/filename.tar.gz

i.e if you are in

/path/to/folder/

You can do the following…

tar -zxvf filename.tar.gz

View a list of all files in a .tar.gz archive

gunzip -c /path/to/folder/filename.tar.gz | tar -tvf -

i.e if you are in

/path/to/folder/

You can do the following…

gunzip -c filename.tar.gz | tar -tvf -

Extract a single file from a .tar.gz file

gunzip -c /path/to/folder/filename.tar.gz | tar -xvf - path/within/archive/filename.php

i.e if you are in

/path/to/folder/

You can do the following…

gunzip -c filename.tar.gz | tar -xvf - path/within/archive/filename.php

You can also add a date stamp to the tarball by using the following example below…

tar -czf public_html-`date +%d%m%y`.tar.gz public_html

Так же в этом разделе:
 
MyTetra Share v.0.59
Яндекс индекс цитирования