How to use the tar tool to create archive files

Knowledge Base - How To

How to use the tar tool to create archive files

to create the archive file /path/to/archive.tar.gz from the file /path/to/file

tar -cvf /path/to/archive.tar.gz /path/to/file

where c -> create, v -> verify, f -> file.

Note the file so created is not compressed. To do so, add the z -> zip flag like

tar -cvfz /path/to/archive.tar.gz /path/to/file