1
0

tar 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. .TH TAR 1
  2. .SH NAME
  3. tar \- archiver
  4. .SH SYNOPSIS
  5. .B tar
  6. .I key
  7. [
  8. .I file ...
  9. ]
  10. .SH DESCRIPTION
  11. .PP
  12. .I Tar
  13. saves and restores file trees.
  14. It is most often used to transport a tree of files from one
  15. system to another.
  16. The
  17. .I key
  18. is a string that contains
  19. at most one function letter plus optional modifiers.
  20. Other arguments to the command are names of
  21. files or directories to be dumped or restored.
  22. A directory name implies all the contained
  23. files and subdirectories (recursively).
  24. .PP
  25. The function is one of the following letters:
  26. .TP
  27. .B c
  28. Create a new archive with the given files as contents.
  29. .TP
  30. .B x
  31. Extract the named files from the archive.
  32. If a file is a directory, the directory is extracted recursively.
  33. Modes are restored if possible.
  34. If no file argument is given, extract the entire archive.
  35. If the archive contains multiple entries for a file,
  36. the latest one wins.
  37. .TP
  38. .B t
  39. List all occurrences of each
  40. .I file
  41. in the archive, or of all files if there are no
  42. .I file
  43. arguments.
  44. .TP
  45. .B r
  46. The named files
  47. are appended to the archive.
  48. .PP
  49. The modifiers are:
  50. .TP
  51. .B v
  52. (verbose)
  53. Print the name of each file treated
  54. preceded by the function letter.
  55. With
  56. .BR t ,
  57. give more details about the
  58. archive entries.
  59. .TP
  60. .B f
  61. Use the next argument as the name of the archive instead of
  62. the default standard input (for keys
  63. .B x
  64. and
  65. .BR t )
  66. or standard output (for keys
  67. .B c
  68. and
  69. .BR r ).
  70. .TP
  71. .B u
  72. Use the next (numeric) argument as the user id for files in
  73. the output archive. This is only useful when moving files to
  74. a non-Plan 9 system.
  75. .TP
  76. .B g
  77. Use the next (numeric) argument as the group id for files in
  78. the output archive.
  79. .TP
  80. .B R
  81. When extracting, ignore leading slash on file names,
  82. i.e., extract all files relative to the current directory.
  83. .TP
  84. .B T
  85. Modifies the behavior of
  86. .B x
  87. to set the mode and modified time
  88. of each file to that specified in the archive.
  89. .SH EXAMPLES
  90. .I Tar
  91. can be used to copy hierarchies thus:
  92. .IP
  93. .EX
  94. {cd fromdir && tar c .} | {cd todir && tar xT}
  95. .EE
  96. .SH SOURCE
  97. .B /sys/src/cmd/tar.c
  98. .SH SEE ALSO
  99. .IR ar (1),
  100. .IR bundle (1),
  101. .IR tapefs (1)
  102. .SH BUGS
  103. There is no way to ask for any but the last
  104. occurrence of a file.
  105. .br
  106. File path names are limited to
  107. 100 characters.
  108. .br
  109. The tar format allows specification of links and symbolic links,
  110. concepts foreign to Plan 9: they are ignored.