Compress in .tgz: различия между версиями
Материал из wiki.p3.ru
Eternity (обсуждение | вклад) Нет описания правки |
Eternity (обсуждение | вклад) Нет описания правки |
||
(не показаны 2 промежуточные версии этого же участника) | |||
Строка 1: | Строка 1: | ||
[[Категория:CPanel]] | |||
[[Категория:Хостинг]] | |||
==Compress files using tar: == | ==Compress files using tar: == | ||
A tar.gz file and a .tgz file are similar. | A tar.gz file and a .tgz file are similar. | ||
Compress files using tar: | Compress files using tar: | ||
tar -cvzf <name of tarball>.tgz /path/to/source/folder | |||
<code>tar -cvzf <name of tarball>.tgz /path/to/source/folder</code> | |||
'''For example, I want to create a backup.tgz or backup.tar.gz from folder /home/user/project''' | '''For example, I want to create a backup.tgz or backup.tar.gz from folder /home/user/project''' | ||
tar -cvzf backup.tgz /home/user/project | <code>tar -cvzf backup.tgz /home/user/project</code> | ||
tar -cvzf backup.tar.gz /home/user/project | <code>tar -cvzf backup.tar.gz /home/user/project</code> | ||
'''You can use tar cvzf instead of tar -cvzf as well.''' | '''You can use tar cvzf instead of tar -cvzf as well.''' | ||
tar -xvzf backup.tgz | <code>tar -xvzf backup.tgz</code> | ||
tar -xvzf backup.tar.gz | <code>tar -xvzf backup.tar.gz</code> | ||
Mnemonic for compression (the order of the flags do not matter) | Mnemonic for '''compression''' (the order of the flags do not matter) | ||
C ompress | C ompress | ||
Z ee | Z ee | ||
F ile | F ile | ||
V erbose | V erbose | ||
Mnemonic for extraction (the order of the flags do not matter) | |||
Mnemonic for '''extraction''' (the order of the flags do not matter) | |||
e X tract | e X tract | ||
Z ee | Z ee | ||
F ile | F ile | ||
V erbose | V erbose | ||
Текущая версия от 11:02, 12 декабря 2024
Compress files using tar:
A tar.gz file and a .tgz file are similar.
Compress files using tar:
tar -cvzf <name of tarball>.tgz /path/to/source/folder
For example, I want to create a backup.tgz or backup.tar.gz from folder /home/user/project
tar -cvzf backup.tgz /home/user/project
tar -cvzf backup.tar.gz /home/user/project
You can use tar cvzf instead of tar -cvzf as well.
tar -xvzf backup.tgz
tar -xvzf backup.tar.gz
Mnemonic for compression (the order of the flags do not matter)
C ompress
Z ee
F ile
V erbose
Mnemonic for extraction (the order of the flags do not matter)
e X tract
Z ee
F ile
V erbose