Tar

From Psygen Wiki
Revision as of 02:49, 21 December 2016 by Admin (talk | contribs) (Created page with "creates an archive (Commonly called a tarball. 'tar' is short for '<b>t</b>ape <b>ar</b>chive') == Flags == '''-z''' use gzip to compress/read the resulting tarball...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

creates an archive (Commonly called a tarball. 'tar' is short for 'tape archive')

Flags

   -z use gzip to compress/read the resulting tarball
   
   -j use bzip2 to compress/read the tarball
   
   -c create a new archive.
   
   -v verbose. tar will list all the files it's adding to the archive.
   
   -f the result should be saved into a file (as opposed to being stored on a tape)
   
   -t list the contents of an archive
   

Examples:

Create a new archive:

tar -zcvf mytar.tar.gz *

creates a tarball named “mytar.tar.gz”, and archives all files in the current directory into it.

   Extract from an archive:
   
   tar -zxvf mytar.tar.gz 
   
       Extracts all files in the tarball into the current directory.
       
   List the contents of a tarball:
   
       tar -ztvf mytar.tar.gz

References

  1. tar man page
  2. Ultimate Tar Command Tutorial