tar: basic tar options
1
1 2.3 Basic 'tar' Operations and Options
1 ======================================
1
1 'tar' can take a wide variety of arguments which specify and define the
1 actions it will have on the particular set of files or the archive. The
1 main types of arguments to 'tar' fall into one of two classes:
1 operations, and options.
1
1 Some arguments fall into a class called "operations"; exactly one of
1 these is both allowed and required for any instance of using 'tar'; you
1 may _not_ specify more than one. People sometimes speak of "operating
1 modes". You are in a particular operating mode when you have specified
1 the operation which specifies it; there are eight operations in total,
1 and thus there are eight operating modes.
1
1 The other arguments fall into the class known as "options". You are
1 not required to specify any options, and you are allowed to specify more
1 than one at a time (depending on the way you are using 'tar' at that
1 time). Some options are used so frequently, and are so useful for
1 helping you type commands more carefully that they are effectively
1 "required". We will discuss them in this chapter.
1
1 You can write most of the 'tar' operations and options in any of
1 three forms: long (mnemonic) form, short form, and old style. Some of
1 the operations and options have no short or "old" forms; however, the
1 operations and options which we will cover in this tutorial have
1 corresponding abbreviations. We will indicate those abbreviations
1 appropriately to get you used to seeing them. Note, that the "old
1 style" option forms exist in GNU 'tar' for compatibility with Unix
1 'tar'. In this book we present a full discussion of this way of writing
1 options and operations (⇒Old Options), and we discuss the other
DONTPRINTYET 1 two styles of writing options (⇒Long Options, and *noteShort
1DONTPRINTYET 1 two styles of writing options (⇒Long Options, and ⇒Short
Options).
1
1 In the examples and in the text of this tutorial, we usually use the
1 long forms of operations and options; but the "short" forms produce the
1 same result and can make typing long 'tar' commands easier. For
1 example, instead of typing
1
1 tar --create --verbose --file=afiles.tar apple angst aspic
1
1 you can type
1 tar -c -v -f afiles.tar apple angst aspic
1
1 or even
1 tar -cvf afiles.tar apple angst aspic
1
1 For more information on option syntax, see ⇒Advanced tar. In
1 discussions in the text, when we name an option by its long form, we
1 also give the corresponding short option in parentheses.
1
1 The term, "option", can be confusing at times, since "operations" are
1 often lumped in with the actual, _optional_ "options" in certain general
1 class statements. For example, we just talked about "short and long
1 forms of options and operations". However, experienced 'tar' users
1 often refer to these by shorthand terms such as, "short and long
1 options". This term assumes that the "operations" are included, also.
1 Context will help you determine which definition of "options" to use.
1
1 Similarly, the term "command" can be confusing, as it is often used
1 in two different ways. People sometimes refer to 'tar' "commands". A
1 'tar' "command" is the entire command line of user input which tells
1 'tar' what to do -- including the operation, options, and any arguments
1 (file names, pipes, other commands, etc.). However, you will also
1 sometimes hear the term "the 'tar' command". When the word "command" is
1 used specifically like this, a person is usually referring to the 'tar'
1 _operation_, not the whole line. Again, use context to figure out which
1 of the meanings the speaker intends.
1