Tar Utility on Linux

"Tar" is a utility developed by GNU Linux users to simplify backup and archive files, and compress for storage needs further. The utility is in almost all Linux distributions and has the ability to utilize different types of storage media.
Package files are archived with tar, also called tarballs, can usually be identified by the extension.
Compression can be. Gz,. Z,. Bz2 or the other, depending on the program used data compression, as well as without. Compressed tarball to state that does not use any compression. Tarballs can load multiple files, directories, and other important information relating to the file itself, and save them in various types of storage media (floppy disks, CDs, hard drives, tape drives, and other media).

2. Option - option to tar

As a utility-based CLI (Command Line Interface), the prevalence of the use of tar followed CLI applications that are used to follow the following procedures:

tar [options ...] NamaTarballs [NamaFile_atau_Direktori ...]

A complete options provided by the tar can be seen in the related manual by typing man tar tar in the CLI. Do not forget, all the commands and options are case sensitive tar, meaning that the use of capital letters and lowercase letters are not the same.

Option subject to tar ::

A add files to the tarball
- Catenate
- Concatenate

c create a new tarball
- Create

d Find the difference between the contents of the tarball or compare and
- Diff files in system
- Compare

- Delete delete the contents of the tarball, this command should not be used in magnetic tape

r append files to the end of the tarball
- Append

t display the contents of the tarball
- List

u replace the files in the tarball with a newer file
- Update

x pull out files from tarball
- Extract
- Get

Some additional options ::

- Atime-preserve do not change access dates of files released

- Show the name of the checkpoint directory when reading the tarball

f Use the tarball file name or devais F (default / dev/rmt0)
- File [HOSTNAME:] F

h Do not remove the symbolic link, but remove the destination file
- Dereference symbolic link

k keep files that already exist on the filesystem, do not overwrite
- Keep-old-files with files from tarball

l remain in the local filesystem when making a tarball
- One-file-system

m not remove the files modification time information
- Modification-time

M to create / display / remove from multi-volume tarballs
- Multi-volume

N only save files older than date date
- After-date date
- Newer date

O Remove files to standard output
- To-stdout

p Remove all information protection / permisions
- Same-permissions
- Preserve-permissions

P do not waste prefix `/` from name files
- Absolute-paths

- Preserve same-p-s

R show the number of records in a tarball with each message
- Record-number

- Remove-files remove files after adding them to the archive

s show the name of the files that will be released sequentially from
- Same-order sequential tarball
- Preserve-order

- Same-owner Create a file is removed from the archive with the same ownership

- Totals show the total bytes yagn ditulisdengan option - create

v View a list of words that have been processed files
- Verbose

V for volume names LABEL tarball
- Label LABEL

- Write down version of the program version information used tar

w confirm each action
- Interactive
- Confirmation

W did verify the tarball after written / created
- Verify

- Exclude filelist do not include a file called filelist

X do not include files are written in the filelist
- Exclude-from filelist

y filter tarball with bzip2
- Bzip2
- Bunzip2

Z filter with compressed tarball
- Compress
- Uncompress

z filter through gzip tarball
- Gzip
- Ungzip

- Use-compress-program tarball with PG filter program called PG
(Program must be able to accept the option-d)

- Block-compress block the output of compression program for tapes

- [0-7] [LMH] spesifikasikasikan drive and density

3. Examples of simple use

tar-xvf foo.tar
remove the contents of the file foo.tar with words - words (verbose)

tar-xvzf foo.tar.gz
remove the contents of the file foo.tar.gz with words - words (verbose)

tar-cvf foo.tar foo /
dr make a tar file named foo that folder with words - words (verbose)

4. Cover

so basic - basic use of tar and a few examples of common usage that we meet. For more complex opsi2 you please combine and adjust as needed. and for more details please read the manual could pagenya (man tar).

5. Reference
$ Man tar

Related : Tar Utility on Linux.