learnanna.blogg.se

Tar command unix untar
Tar command unix untar










  1. #Tar command unix untar how to#
  2. #Tar command unix untar archive#
  3. #Tar command unix untar plus#

However, before doing this, there are several steps that should be taken. Tar can also be used for unpacking tar files.

tar command unix untar

#Tar command unix untar archive#

Thus, for example, the following would create an archive named 2 of the files file4, file5 and file6 that is compressed using bzip2: They are -j (for bzip2), -z (for gzip) and -Z (for compress). A very handy feature of the GNU version (which is standard on Linux) is the availability of options that will cause standard compression programs to compress a new archive file as soon as it has been created. However, they can be removed when using tar by adding the -remove-files option.Īs it has no compression and decompression capabilities of its own, tar is commonly used in combination with an external compression utility. The following example uses the star wildcard (i.e., an asterisk), which represents any character or sequence of characters, to create an archive of every object in the current directory:īy default, tar creates an archive of copies of the original files and/or directories, and the originals are retained. It is often convenient to use tar with a wildcard (i.e., a character which can represent some specific class of characters or sequence of characters). For example, the contents of two directories named dir1 and dir2 could be archived into a file named dir.tar with the following: The result is recursive that is, it includes all objects (e.g., directories and files) within each level of directories. Tar can also be used to make archives from the contents of one or more directories. In such case, the above example would become The -v (i.e., verbose) option is commonly used together with the -c and -f options in order to display a list of the files that are included in the archive. It is necessary, however, that the -f option be the final option in a sequence of contiguous, single-letter options otherwise, the system will become confused as to the desired name for the new file and will use the next option in the sequence as the name. tar extension however, the use of this extension can be is very convenient because it allows the type of file to be visually identified. It it not absolutely necessary that the new file have the. Thus, for example, the following would create an archive file called file.tar from the three files named file1, file2 and file3 that are located in the current directory (i.e., the directory in which the user is currently working): The former instructs tar to create an archive and the latter indicates that the next argument (i.e., piece of input data in a command) will be the name of the new archive file.

tar command unix untar

Tar files are created by using both the -c and -f options. Unlike many commands, tar requires the use of at least one option, and usually two or more are necessary. Tar has numerous options, many of which are not frequently used.

tar command unix untar

However, it is very easy to compress archives created with tar by using specialized compression utilities. Unlike some other archiving programs, and consistent with the Unix philosophy that each individual program should be designed to do only one thing but do it well, tar does not perform compression. Archives that have been created with tar are commonly referred to as tarballs. Moreover, they are very easy to work with, often much more so than dealing with large numbers of individual files.Īlthough tar was originally designed for backups on magnetic tape, it can now be used to create archive files anywhere on a filesystem. Archives are convenient for storing files as well as for for transmitting data and distributing programs.

#Tar command unix untar plus#

The tar (i.e., tape archive) command is used to convert a group of files into an archive.Īn archive is a single file that contains any number of individual files plus information to allow them to be restored to their original form by one or more extraction programs.

#Tar command unix untar how to#

How to use the tar command, by The Linux Information Project (LINFO) LINFO












Tar command unix untar