tar command functioon Print

  • 0

Create, Extract, See Contents
The tar program takes one of three funcion command line arguments

c --- to create a tar file, writing the file starts at the beginning.

t --- table of contents, see the names of all files or those specified in other command line arguments.

x --- extract (restore) the contents of the tar file

 

Compression, Verbose, File specified
In addition to a function command line argument the arguments below are useful. I usually use z and f all the time, and v when creating/extracting.

f --- specifies the filename (which follows the f) used to tar into or to tar out from; see the examples below.

z --- use zip/gzip to compress the tar file or to read from a compressed tar file.

v --- verbose output, show, e.g., during create or extract, the files being stored into or restored from the tar file

 

tar a directory

tar cvzf directory.tar.gz directoryname

 

untar a tar file

tar xvzf directory.tar.gz

 

tar cvzf directory.tar.gz directoryname



Was this answer helpful?

« Back