GNU tar: an archiver tool

FTP release, version 1.35, 22 August 2023

John Gilmore, Jay Fenlason et al.

This manual is for GNU tar (version 1.35, 22 August 2023), which creates and extracts files from archives.

Copyright © 1992, 1994–1997, 1999–2001, 2003–2017, 2021–2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with the Invariant Sections being “GNU General Public License”, with the Front-Cover Texts being “A GNU Manual”, and with the Back-Cover Texts as in (a) below. A copy of the license is included in the section entitled “GNU Free Documentation License”.

(a) The FSF’s Back-Cover Text is: “You have the freedom to copy and modify this GNU manual.”


[ < ] [ > ] [Contents] [Index] [ ? ]

GNU tar: an archiver tool

This manual is for GNU tar (version 1.35, 22 August 2023), which creates and extracts files from archives.

Copyright © 1992, 1994–1997, 1999–2001, 2003–2017, 2021–2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with the Invariant Sections being “GNU General Public License”, with the Front-Cover Texts being “A GNU Manual”, and with the Back-Cover Texts as in (a) below. A copy of the license is included in the section entitled “GNU Free Documentation License”.

(a) The FSF’s Back-Cover Text is: “You have the freedom to copy and modify this GNU manual.”

The first part of this master menu lists the major nodes in this Info document. The rest of the menu lists all the lower level nodes.

1 Introduction
2 Tutorial Introduction to tar
3 Invoking GNU tar
4 GNU tar Operations
5 Performing Backups and Restoring Files
6 Choosing Files and Names for tar
7 Date input formats
8 Controlling the Archive Format
9 Tapes and Other Archive Media
10 Reliability and Security
Appendices
Appendix A Changes
Appendix B Recipes Frequently used tar recipes
Appendix C Configuring Help Summary
Appendix D Fixing Snapshot Files
Appendix E Tar Internals
Appendix F Genfile
Appendix G GNU Free Documentation License
Appendix H Index of Command Line Options
Appendix I Index
 — The Detailed Node Listing —
Introduction
1.1 What this Book Contains
1.2 Some Definitions
1.3 What tar Does
1.4 How tar Archives are Named
1.5 GNU tar Authors
1.6 Reporting bugs or suggestions
Tutorial Introduction to tar
2.1 Assumptions this Tutorial Makes
2.2 Stylistic Conventions
2.3 Basic tar Operations and Options
2.4 The Three Most Frequently Used Operations
2.5 Two Frequently Used Options
2.6 How to Create Archives
2.7 How to List Archives
2.8 How to Extract Members from an Archive
2.9 Going Further Ahead in this Manual
Two Frequently Used Options
The ‘--file’ Option
The ‘--verbose’ Option
Getting Help: Using the ‘--help’ Option
How to Create Archives
2.6.1 Preparing a Practice Directory for Examples
2.6.2 Creating the Archive
2.6.3 Running ‘--create’ with ‘--verbose
2.6.4 Short Forms with ‘create
2.6.5 Archiving Directories
How to List Archives
Listing the Contents of a Stored Directory
How to Extract Members from an Archive
2.8.1 Extracting an Entire Archive
2.8.2 Extracting Specific Files
2.8.3 Extracting Files that are Directories
2.8.4 Extracting Archives from Untrusted Sources
2.8.5 Commands That Will Fail
Invoking GNU tar
3.1 General Synopsis of tar
3.2 Using tar Options
3.3 The Three Option Styles
3.4 All tar Options
3.5 GNU tar documentation Where to Get Help.
3.6 Obtaining GNU tar default values What are the Default Values.
3.7 Checking tar progress
3.8 Checkpoints
3.9 Controlling Warning Messages
3.10 Asking for Confirmation During Operations
3.11 Running External Commands
The Three Option Styles
3.3.1 Long Option Style
3.3.2 Short Option Style
3.3.3 Old Option Style
3.3.4 Mixing Option Styles
All tar Options
3.4.1 Operations
3.4.2 tar Options
3.4.3 Short Options Cross Reference
3.4.4 Position-Sensitive Options
Controlling Warning Messages
3.9.1 Keywords controlling tar operation Keywords applicable for tar --create.
3.9.2 Keywords applicable for tar --create
3.9.3 Keywords applicable for tar --extract
3.9.4 Keywords controlling incremental extraction
3.9.5 Warning Classes Convenience keywords control multiple warnings.
3.9.6 Default Warning Settings Default settings for warnings.
GNU tar Operations
4.1 Basic GNU tar Operations
4.2 Advanced GNU tar Operations
4.3 Options Used by ‘--create
4.4 Options Used by ‘--extract
4.5 Backup options
4.6 Looking Ahead: The Rest of this Manual
Advanced GNU tar Operations
4.2.1 The Five Advanced tar Operations
4.2.2 How to Add Files to Existing Archives: ‘--append
4.2.3 Updating an Archive
4.2.4 Combining Archives with ‘--concatenate
4.2.5 Removing Archive Members Using ‘--delete
4.2.6 Comparing Archive Members with the File System
How to Add Files to Existing Archives: ‘--append
4.2.2.1 Appending Files to an Archive
4.2.2.2 Multiple Members with the Same Name
Updating an Archive
4.2.3.1 How to Update an Archive Using ‘--update
Options Used by ‘--create
4.3.1 Overriding File Metadata
4.3.2 Extended File Attributes
4.3.3 Ignore Failed Read
Options Used by ‘--extract
4.4.1 Options to Help Read Archives
4.4.2 Changing How tar Writes Files
4.4.3 Coping with Scarce Resources
Options to Help Read Archives
Reading Full Records
Ignoring Blocks of Zeros
Changing How tar Writes Files
Options Controlling the Overwriting of Existing Files
Overwrite Old Files
Keep Old Files
Keep Newer Files
Unlink First
Recursive Unlink
Setting Data Modification Times
Setting Access Permissions
Directory Modification Times and Permissions
Writing to Standard Output
Writing to an External Program
Removing Files
Coping with Scarce Resources
Starting File
Same Order
Performing Backups and Restoring Files
5.1 Using tar to Perform Full Dumps
5.2 Using tar to Perform Incremental Dumps
5.3 Levels of Backups
5.4 Setting Parameters for Backups and Restoration
5.5 Using the Backup Scripts
5.6 Using the Restore Script
Setting Parameters for Backups and Restoration
5.4.1 General-Purpose Variables
5.4.2 Magnetic Tape Control
5.4.3 User Hooks
5.4.4 An Example Text of ‘Backup-specs
Choosing Files and Names for tar
6.1 Choosing and Naming Archive Files Choosing the Archive’s Name
6.2 Selecting Archive Members
6.3 Reading Names from a File
6.4 Excluding Some Files
6.5 Wildcards Patterns and Matching
6.6 Quoting Member Names Ways of Quoting Special Characters in Names
6.7 Modifying File and Member Names
6.8 Operating Only on New Files
6.9 Descending into Directories
6.10 Crossing File System Boundaries
Reading Names from a File
6.3.1 NUL-Terminated File Names
Excluding Some Files
Problems with Using the exclude Options
Wildcards Patterns and Matching
Controlling Pattern-Matching
Crossing File System Boundaries
6.10.1 Changing the Working Directory Changing Directory
6.10.2 Absolute File Names
Date input formats
7.1 General date syntax Common rules
7.2 Calendar date items 21 Jul 2020
7.3 Time of day items 9:20pm
7.4 Time zone items UTC, -0700, +0900, …
7.5 Combined date and time of day items 2020年07月21日T20:02:00,000000-0400
7.6 Day of week items Monday and others
7.7 Relative items in date strings next tuesday, 2 years ago
7.8 Pure numbers in date strings 20200721, 1440
7.9 Seconds since the Epoch @1595289600
7.10 Specifying time zone rules TZ="America/New_York", TZ="UTC0"
7.11 Authors of parse_datetime Bellovin, Eggert, Salz, Berets, et al.
Controlling the Archive Format
8.1 Using Less Space through Compression
8.2 Handling File Attributes
8.3 Making tar Archives More Portable
8.4 Making tar Archives More Reproducible
8.5 Comparison of tar and cpio
Using Less Space through Compression
8.1.1 Creating and Reading Compressed Archives
8.1.2 Archiving Sparse Files
Creating and Reading Compressed Archives
8.1.1.1 Using lbzip2 with GNU tar.
Making tar Archives More Portable
8.3.1 Portable Names
8.3.2 Symbolic Links
8.3.3 Hard Links
8.3.4 Old V7 Archives
8.3.5 Ustar Archive Format Ustar Archives
8.3.6 GNU and old GNU tar format GNU and old GNU format archives.
8.3.7 GNU tar and POSIX tar POSIX archives
8.3.8 Checksumming Problems
8.3.9 Large or Negative Values Large files, negative time stamps, etc.
8.3.10 How to Extract GNU-Specific Data Using Other tar Implementations
GNU tar and POSIX tar
8.3.7.1 Controlling Extended Header Keywords
How to Extract GNU-Specific Data Using Other tar Implementations
8.3.10.1 Extracting Members Split Between Volumes Members Split Between Volumes
8.3.10.2 Extracting Sparse Members Sparse Members
Tapes and Other Archive Media
9.1 Device Selection and Switching Device selection and switching
9.2 Remote Tape Server
9.3 Some Common Problems and their Solutions
9.4 Blocking
9.5 Many Archives on One Tape Many archives on one tape
9.6 Using Multiple Tapes
9.7 Including a Label in the Archive
9.8 Verifying Data as It is Stored
9.9 Write Protection
Blocking
9.4.1 Format Variations
9.4.2 The Blocking Factor of an Archive
Many Archives on One Tape
9.5.1 Tape Positions and Tape Marks
9.5.2 The mt Utility
Using Multiple Tapes
9.6.1 Archives Longer than One Tape or Disk
9.6.2 Tape Files
9.6.3 Concatenate Volumes into a Single Archive
Reliability and Security
10.1 Reliability
10.2 Security
Reliability
10.1.1 Permissions Problems
10.1.2 Data Corruption and Repair
10.1.3 Race conditions
Security
10.2.1 Privacy
10.2.2 Integrity
10.2.3 Dealing with Live Untrusted Data
10.2.4 Security Rules of Thumb
Recipes
B.1 Copying directory hierarchies
B.2 Restoring Intermediate Directories
Tar Internals
Basic Tar Format
GNU Extensions to the Archive Format
Storing Sparse Files
Format of the Incremental Snapshot Files
Dumpdir
Storing Sparse Files
E.0.1 Old GNU Format
E.0.2 PAX Format, Versions 0.0 and 0.1
E.0.3 PAX Format, Version 1.0
Genfile
F.1 Generate Mode File Generation Mode.
F.2 Status Mode File Status Mode.
F.4 Exec Mode Synchronous Execution mode.
Copying This Manual
Appendix G GNU Free Documentation License License for copying this manual.

[ < ] [ > ] [Contents] [Index] [ ? ]

This document was generated on August 23, 2023 using texi2html 5.0.

AltStyle によって変換されたページ (->オリジナル) /