Browsing articles tagged with

tar

10 quick tar command examples to create/extract archives in Linux

Tar command on Linux The tar (tape archive) command is a frequently used command on linux that allows you to store files into an archive. The commonly seen file extensions are .tar.gz and .tar.bz2 which is a tar archive further compressed using gzip or bzip algorithms respectively. In this tutorial we shall take a look at simple examples of using the tar ...

How to extract tar.gz archives in php

In a previous article we learned how to . Now lets do the reverse, that is extract tar.gz archives and get the files out. The code to extract a tar.gz archive is very simple and uses PharData class. Here is an example // decompress from gz $p = new PharData('files.tar.gz'); $p->decompress(); // creates files.tar // unarchive from the tar $phar = new PharData('files.tar'); $phar->extractTo('new_dir'); The first step ...

How to create tar archives in php

Tar is a common archive format used on linux. Alone it is just an archiving format, that is it can only pack multiple files together but not compress them. When combined with gzip or bzip2 files are compressed as well. Then it becomes a .tar.gz which is actually a gzip compressed tar file. Php has a class called PharData that can ...



Connect with us