Go to the first, previous, next, last section, table of contents.


Selecting Archive Members

File Name arguments specify which files in the file system tar operates on, when creating or adding to an archive, or which archive members tar operates on, when reading or deleting from an archive. See section The Five Advanced tar Operations.

To specify file names, you can include them as the last arguments on the command line, as follows:

tar operation [option1 option2 ...] [file name-1 file name-2 ...]

If you specify a directory name as a file name argument, all the files in that directory are operated on by tar.

If you do not specify files when tar is invoked with --create (-c), tar operates on all the non-directory files in the working directory. If you specify either --list (-t) or --extract (--get, -x), tar operates on all the archive members in the archive. If you specify any operation other than one of these three, tar does nothing.

By default, tar takes file names from the command line. However, there are other ways to specify file or member names, or to modify the manner in which tar selects the files or members upon which to operate; @FIXME{add xref here}. In general, these methods work both for specifying the names of files and archive members.


Go to the first, previous, next, last section, table of contents.