UNIX systems usually support a number of utilities for backing up and compressing files. The most useful are:
tar (tape archiver)
tar backs up entire directories and files onto a tape device or (more commonly) into a single disk file known as an archive. An archive is a file that contains other files plus information about them, such as their filename, owner, timestamps, and access permissions. tar does not perform any compression by default.
To create a disk file tar archive, use
$ tar -cvf archivenamefilenames
where archivename will usually have a .tar extension. Here the c option means create, v means verbose (output filenames as they are archived), and f means file.To list the contents of a tar archive, use
$ tar -tvf archivename
To restore files from a tar archive, use
$ tar -xvf archivename
cpio
cpio is another facility for creating and reading archives. Unlike tar, cpio doesn't automatically archive the contents of directories, so it's common to combine cpio with find when creating an archive:
$ find . -print -depth | cpio -ov -Htar > archivename
This will take all the files in the current directory and the
directories below and place them in an archive called archivename.The -depth option controls the order in which the filenames are produced and is recommended to prevent problems with directory permissions when doing a restore.The -o option creates the archive, the -v option prints the names of the files archived as they are added and the -H option specifies an archive format type (in this case it creates a tar archive). Another common archive type is crc, a portable format with a checksum for error control.
To list the contents of a cpio archive, use
$ cpio -tv < archivename
To restore files, use:
$ cpio -idv < archivename
Here the -d option will create directories as necessary. To force cpio to extract files on top of files of the same name that already exist (and have the same or later modification time), use the -u option.
compress, gzip
compress and gzip are utilities for compressing and decompressing individual files (which may be or may not be archive files). To compress files, use:
$ compress filename
or
$ gzip filename
In each case, filename will be deleted and replaced by a compressed file called filename.Z or filename.gz. To reverse the compression process, use:
$ compress -d filename
or
$ gzip -d filename
tar (tape archiver)
tar backs up entire directories and files onto a tape device or (more commonly) into a single disk file known as an archive. An archive is a file that contains other files plus information about them, such as their filename, owner, timestamps, and access permissions. tar does not perform any compression by default.
To create a disk file tar archive, use
$ tar -cvf archivenamefilenames
where archivename will usually have a .tar extension. Here the c option means create, v means verbose (output filenames as they are archived), and f means file.To list the contents of a tar archive, use
$ tar -tvf archivename
To restore files from a tar archive, use
$ tar -xvf archivename
cpio
cpio is another facility for creating and reading archives. Unlike tar, cpio doesn't automatically archive the contents of directories, so it's common to combine cpio with find when creating an archive:
$ find . -print -depth | cpio -ov -Htar > archivename
This will take all the files in the current directory and the
directories below and place them in an archive called archivename.The -depth option controls the order in which the filenames are produced and is recommended to prevent problems with directory permissions when doing a restore.The -o option creates the archive, the -v option prints the names of the files archived as they are added and the -H option specifies an archive format type (in this case it creates a tar archive). Another common archive type is crc, a portable format with a checksum for error control.
To list the contents of a cpio archive, use
$ cpio -tv < archivename
To restore files, use:
$ cpio -idv < archivename
Here the -d option will create directories as necessary. To force cpio to extract files on top of files of the same name that already exist (and have the same or later modification time), use the -u option.
compress, gzip
compress and gzip are utilities for compressing and decompressing individual files (which may be or may not be archive files). To compress files, use:
$ compress filename
or
$ gzip filename
In each case, filename will be deleted and replaced by a compressed file called filename.Z or filename.gz. To reverse the compression process, use:
$ compress -d filename
or
$ gzip -d filename

















rin2


Sukanjan.K

![[-] [-]](images/tech//collapse.gif)


