Archiving and Compression

Archiving and compression at the time:

Syntax:

tar <option> files/dir

Options: Z (if we are using gzip compression)

j (if we are using bzip2)

x (Extracts)

v (verbose mode)

f (for archived file)

t (list the content of an archived file)

# tar zcvf gvn.tar.gz /etc (gvn.tar.gz is file name)

# tar jcvf bun.tar.bz2 /etc

Tar to floppies:

# tar zcvf /dev/fd0 test

(Contents of directory test are archived in floppy)

To extract we have to extract from device itself

# tar zxvf /dev/fd0

(We will now get test directory)