tar options archive files
tar puts one or more les into an archive. Compression is optional. tar is a quite
complex command with a number of options available. The most frequently used
options are:
-f
Writes the output to a le and not to the screen as is usually the case
-c
Creates a new tar archive
-r
Adds les to an existing archive
-t
Outputs the contents of an archive
-u
Adds les, but only if they are newer than the les already contained in the
archive
-x
Unpacks les from an archive (extraction)
-z
Packs the resulting archive with gzip
-j
Compresses the resulting archive with bzip2
-v
Lists les processed
The archive les created by tar end with .tar. If the tar archive was also com-
pressed using gzip, the ending is .tgz or .tar.gz. If it was compressed using
bzip2, the ending is .tar.bz2.
locate patterns
This command is only available if you have installed the findutils-locate pack-
age. The locate command can nd in which directory a specied le is located.
If desired, use wild cards to specify lenames. The program is very fast, because
it uses a database specically created for the purpose (rather than searching
through the entire le system). This very fact, however, also results in a major
drawback: locate is unable to nd any les created after the latest update of its
database. The database can be generated by root with updatedb.
updatedb [options]
This command performs an update of the database used by locate. To include
les in all existing directories, run the program as root. It also makes sense to
Shell Basics 109