Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Tar unlike zip allow you to keep permissions. As such it is the defacto utility for making backups. Also if you can keep your user UIDs consistent across environments, tar allows for quick disaster recovery.

Warning

This article still needs to be completed.

Must Read

Before using tar there are one critical behaviour to understand, always tar using relative paths. Otherwise you risk overwriting your data when untaring.

Warning

TBC Roderick, put Put an example of that here with more details.

Create linux tar gz (Gzip) archive

tar -czvf cvfz myarchive.tgz tar.gz mydirectory/We use the -t option to create an linux tar archive

Panel

-c, –create create a new archive


...

Note that .tgztar.gz is the same thing as .tartgz.gz

Create linux simple tar archive (withouth compresion)

tar -cvf myarchive.tar mydirectory/

Extracting

...

Extract linux tar gz (Gzip) archive,

Code Block
languagebash
tar -xzvf mystuff.tgz
Note

The f flag must come at the end or you will get an error.

 

Extract linux simple tar archive
tar -xvf mystuff.tar....

We use -x to extract the files form the tar archive
-x, –extract, –get extract files from an archive

...