tar.texi

来自「gnu tar 源码包。 tar 软件是 Unix 系统下的一个打包软件」· TEXI 代码 · 共 1,767 行 · 第 1/5 页

TEXI
1,767
字号
* Device::                      Device selection and switching* Remote Tape Server::* Common Problems and Solutions::* Blocking::                    Blocking* Many::                        Many archives on one tape* Using Multiple Tapes::        Using Multiple Tapes* label::                       Including a Label in the Archive* verify::* Write Protection::Blocking* Format Variations::           Format Variations* Blocking Factor::             The Blocking Factor of an ArchiveMany Archives on One Tape* Tape Positioning::            Tape Positions and Tape Marks* mt::                          The @command{mt} UtilityUsing Multiple Tapes* Multi-Volume Archives::       Archives Longer than One Tape or Disk* Tape Files::                  Tape Files* Tarcat::                      Concatenate Volumes into a Single ArchiveTar Internals* Standard::           Basic Tar Format* Extensions::         @acronym{GNU} Extensions to the Archive Format* Sparse Formats::     Storing Sparse Files* Snapshot Files::* Dumpdir::Storing Sparse Files* Old GNU Format::* PAX 0::                PAX Format, Versions 0.0 and 0.1* PAX 1::                PAX Format, Version 1.0Genfile* Generate Mode::     File Generation Mode.* Status Mode::       File Status Mode.* Exec Mode::         Synchronous Execution mode.Copying This Manual* GNU Free Documentation License::  License for copying this manual@end detailmenu@end menu@node Introduction@chapter Introduction@GNUTAR{} createsand manipulates @dfn{archives} which are actually collections ofmany other files; the program provides users with an organized andsystematic method for controlling a large amount of data.The name ``tar'' originally came from the phrase ``Tape ARchive'', butarchives need not (and these days, typically do not) reside on tapes.@menu* Book Contents::               What this Book Contains* Definitions::                 Some Definitions* What tar Does::               What @command{tar} Does* Naming tar Archives::         How @command{tar} Archives are Named* Authors::                     @GNUTAR{} Authors* Reports::                     Reporting bugs or suggestions@end menu@node Book Contents@section What this Book ContainsThe first part of this chapter introduces you to various terms that willrecur throughout the book.  It also tells you who has worked on @GNUTAR{}and its documentation, and where you should send bug reportsor comments.The second chapter is a tutorial (@pxref{Tutorial}) which provides agentle introduction for people who are new to using @command{tar}.  It ismeant to be self contained, not requiring any reading from subsequentchapters to make sense.  It moves from topic to topic in a logical,progressive order, building on information already explained.Although the tutorial is paced and structured to allow beginners tolearn how to use @command{tar}, it is not intended solely for beginners.The tutorial explains how to use the three most frequently usedoperations (@samp{create}, @samp{list}, and @samp{extract}) as well astwo frequently used options (@samp{file} and @samp{verbose}).  The otherchapters do not refer to the tutorial frequently; however, if a sectiondiscusses something which is a complex variant of a basic concept, theremay be a cross reference to that basic concept.  (The entire book,including the tutorial, assumes that the reader understands some basicconcepts of using a Unix-type operating system; @pxref{Tutorial}.)The third chapter presents the remaining five operations, andinformation about using @command{tar} options and option syntax.The other chapters are meant to be used as a reference.  Each chapterpresents everything that needs to be said about a specific topic.One of the chapters (@pxref{Date input formats}) exists in itsentirety in other @acronym{GNU} manuals, and is mostly self-contained.In addition, one section of this manual (@pxref{Standard}) contains abig quote which is taken directly from @command{tar} sources.In general, we give both long and short (abbreviated) option namesat least once in each section where the relevant option is covered, sothat novice readers will become familiar with both styles.  (A fewoptions have no short versions, and the relevant sections willindicate this.)@node Definitions@section Some Definitions@cindex archive@cindex tar archiveThe @command{tar} program is used to create and manipulate @command{tar}archives.  An @dfn{archive} is a single file which contains the contentsof many files, while still identifying the names of the files, theirowner(s), and so forth.  (In addition, archives record accesspermissions, user and group, size in bytes, and data modification time.Some archives also record the file names in each archived directory, aswell as other file and directory information.)  You can use @command{tar}to @dfn{create} a new archive in a specified directory.@cindex member@cindex archive member@cindex file name@cindex member nameThe files inside an archive are called @dfn{members}.  Within thismanual, we use the term @dfn{file} to refer only to files accessible inthe normal ways (by @command{ls}, @command{cat}, and so forth), and the term@dfn{member} to refer only to the members of an archive.  Similarly, a@dfn{file name} is the name of a file, as it resides in the file system,and a @dfn{member name} is the name of an archive member within thearchive.@cindex extraction@cindex unpackingThe term @dfn{extraction} refers to the process of copying an archivemember (or multiple members) into a file in the file system.  Extractingall the members of an archive is often called @dfn{extracting thearchive}.  The term @dfn{unpack} can also be used to refer to theextraction of many or all the members of an archive.  Extracting anarchive does not destroy the archive's structure, just as creating anarchive does not destroy the copies of the files that exist outside ofthe archive.  You may also @dfn{list} the members in a given archive(this is often thought of as ``printing'' them to the standard output,or the command line), or @dfn{append} members to a pre-existing archive.All of these operations can be performed using @command{tar}.@node What tar Does@section What @command{tar} Does@cindex tarThe @command{tar} program provides the ability to create @command{tar}archives, as well as various other kinds of manipulation.  For example,you can use @command{tar} on previously created archives to extract files,to store additional files, or to update or list files which were alreadystored.Initially, @command{tar} archives were used to store files conveniently onmagnetic tape.  The name @command{tar} comes from this use; it stands for@code{t}ape @code{ar}chiver.  Despite the utility's name, @command{tar} candirect its output to available devices, files, or other programs (usingpipes).  @command{tar} may even access remote devices or files (as archives).You can use @command{tar} archives in many ways.  We want to stress a fewof them: storage, backup, and transportation.@FIXME{the following table entries need a bit of work.}@table @asis@item StorageOften, @command{tar} archives are used to store related files forconvenient file transfer over a network.  For example, the@acronym{GNU} Project distributes its software bundled into@command{tar} archives, so that all the files relating to a particularprogram (or set of related programs) can be transferred as a singleunit.A magnetic tape can store several files in sequence.  However, the tapehas no names for these files; it only knows their relative position onthe tape.  One way to store several files on one tape and retain theirnames is by creating a @command{tar} archive.  Even when the basic transfermechanism can keep track of names, as FTP can, the nuisance of handlingmultiple files, directories, and multiple links makes @command{tar}archives useful.Archive files are also used for long-term storage.  You can think ofthis as transportation from the present into the future.  (It is ascience-fiction idiom that you can move through time as well as inspace; the idea here is that @command{tar} can be used to move archives inall dimensions, even time!)@item BackupBecause the archive created by @command{tar} is capable of preservingfile information and directory structure, @command{tar} is commonlyused for performing full and incremental backups of disks.  A backupputs a collection of files (possibly pertaining to many users andprojects) together on a disk or a tape.  This guards againstaccidental destruction of the information in those files.@GNUTAR{} has special features that allow it to beused to make incremental and full dumps of all the files in afile system.@item TransportationYou can create an archive on one system, transfer it to another system,and extract the contents there.  This allows you to transport a group offiles from one system to another.@end table@node Naming tar Archives@section How @command{tar} Archives are NamedConventionally, @command{tar} archives are given names ending with@samp{.tar}.  This is not necessary for @command{tar} to operate properly,but this manual follows that convention in order to accustom readers toit and to make examples more clear.@cindex tar file@cindex entry@cindex tar entryOften, people refer to @command{tar} archives as ``@command{tar} files,'' andarchive members as ``files'' or ``entries''.  For people familiar withthe operation of @command{tar}, this causes no difficulty.  However, inthis manual, we consistently refer to ``archives'' and ``archivemembers'' to make learning to use @command{tar} easier for novice users.@node Authors@section @GNUTAR{} Authors@GNUTAR{} was originally written by John Gilmore,and modified by many people.  The @acronym{GNU} enhancements werewritten by Jay Fenlason, then Joy Kendall, and the whole package hasbeen further maintained by Thomas Bushnell, n/BSG, Fran@,{c}oisPinard, Paul Eggert, and finally Sergey Poznyakoff with the help ofnumerous and kind users.We wish to stress that @command{tar} is a collective work, and owes much toall those people who reported problems, offered solutions and otherinsights, or shared their thoughts and suggestions.  An impressive, yetpartial list of those contributors can be found in the @file{THANKS}file from the @GNUTAR{} distribution.@FIXME{i want all of these names mentioned, Absolutely.  BUT, i'm notsure i want to spell out the history in this detail, at least not forthe printed book.  i'm just not sure it needs to be said this way.i'll think about it.}@FIXME{History is more important, and surely more interesting, thanactual names.  Quoting names without history would be meaningless.  FP}Jay Fenlason put together a draft of a @GNUTAR{}manual, borrowing notes from the original man page from John Gilmore.This was withdrawn in version 1.11.  Thomas Bushnell, n/BSG and AmyGorin worked on a tutorial and manual for @GNUTAR{}.Fran@,{c}ois Pinard put version 1.11.8 of the manual together bytaking information from all these sources and merging them.  MelissaWeisshaus finally edited and redesigned the book to create version1.12.  The book for versions from 1.14 up to @value{VERSION} were editedby the current maintainer, Sergey Poznyakoff.For version 1.12, Daniel Hagerty contributed a great deal of technicalconsulting.  In particular, he is the primary author of @ref{Backups}.In July, 2003 @GNUTAR{} was put on CVS at savannah.gnu.org(see @url{http://savannah.gnu.org/projects/tar}), andactive development and maintenance work has startedagain.  Currently @GNUTAR{} is being maintained by Paul Eggert, SergeyPoznyakoff and Jeff Bailey.Support for @acronym{POSIX} archives was added by Sergey Poznyakoff.@node Reports@section Reporting bugs or suggestions@cindex bug reports@cindex reporting bugsIf you find problems or have suggestions about this program or manual,please report them to @file{bug-tar@@gnu.org}.When reporting a bug, please be sure to include as much detail aspossible, in order to reproduce it.  @FIXME{Be more specific, I'dlike to make this node as detailed as 'Bug reporting' node in Emacsmanual}.@node Tutorial@chapter Tutorial Introduction to @command{tar}This chapter guides you through some basic examples of three @command{tar}operations: @option{--create}, @option{--list}, and @option{--extract}.  Ifyou already know how to use some other version of @command{tar}, then youmay not need to read this chapter.  This chapter omits most complicateddetails about how @command{tar} works.@menu* assumptions::* stylistic conventions::* basic tar options::           Basic @command{tar} Operations and Options* frequent operations::* Two Frequent Options::* create::                      How to Create Archives* list::                        How to List Archives* extract::                     How to Extract Members from an Archive* going further::@end menu@node assumptions@section Assumptions this Tutorial MakesThis chapter is paced to allow beginners to learn about @command{tar}slowly.  At the same time, we will try to cover all the basic aspects ofthese three operations.  In order to accomplish both of these tasks, wehave made certain assumptions about your knowledge before reading thismanual, and the hardware you will be using:@itemize @bullet@itemBefore you start to work through this tutorial, you should understandwhat the terms ``archive'' and ``archive member'' mean(@pxref{Definitions}).  In addition, you should understand somethingabout how Unix-type operating systems work, and you should know how touse some basic utilities.  For example, you should know how to create,list, copy, rename, edit, and delete files and directories; how tochange between directories; and how to figure out where you are in thefile system.  You should have some basic understanding of directorystructure and how files are named according to which directory they arein.  You should understand concepts such as standard output and standardinput, what various definitions of the term @samp{argument} mean, and thedifferences between relative and absolute file names.  @FIXME{and whatelse?}@itemThis manual assumes that you are working from your own home directory(unless we state otherwise).  In this tutorial, you will create adirectory to practice @command{tar} commands in.  When we show file names,we will assume that those names are relative to your home directory.For example, my home directory is @file{/home/fsf/melissa}.  All ofmy examples are in a subdirectory of the directory named by that filename; the subdirectory is called @file{practice}.@itemIn general, we show examples of archives which exist on (or can bewritten to, or worked with from) a directory on a hard disk.  In mostcases, you could write those archives to, or work with them on any otherdevice, such as a tape drive.  However, some of the later examples inthe tutorial and next chapter will not work on tape drives.Additionally, working with tapes is much more complicated than workingwith hard disks.  For these reasons, the tutorial does not cover workingwith tape drives.  @xref{Media}, for complete information on using

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?