$7.49 .com domain with free InstantPage Website Builder$1.99 Web Hosting   捷飞网络官方淘宝店   Godaddy 优惠码
返回列表 发帖
分享到:




[软件教程] linux 下tar 命令所有参数帮助文档

linux 下tar 命令所有参数帮助文档2 @1 G7 _& Z$ L7 d  ?
3 b# h, Y+ }+ ^0 l0 ]
  1. [root@localhost]# tar --help
  2. Usage: tar [OPTION...] [FILE]...
  3. GNU `tar' saves many files together into a single tape or disk archive, and can
  4. restore individual files from the archive.

  5. Examples:
  6. tar -cf archive.tar foo bar # Create archive.tar from files foo and bar.
  7. tar -tvf archive.tar # List all files in archive.tar verbosely.
  8. tar -xf archive.tar # Extract all files from archive.tar.

  9. Main operation mode:

  10. -A, --catenate, --concatenate append tar files to an archive
  11. -c, --create create a new archive
  12. -d, --diff, --compare find differences between archive and file system
  13. --delete delete from the archive (not on mag tapes!)
  14. -r, --append append files to the end of an archive
  15. -t, --list list the contents of an archive
  16. -u, --update only append files newer than copy in archive
  17. -x, --extract, --get extract files from an archive

  18. Operation modifiers:

  19. -g, --listed-incremental=FILE handle new GNU-format incremental backup
  20. -G, --incremental handle old GNU-format incremental backup
  21. --ignore-failed-read do not exit with nonzero on unreadable files
  22. -k, --keep-old-files don't replace existing files when extracting
  23. --keep-newer-files don't replace existing files that are newer than
  24. their archive copies
  25. --no-overwrite-dir preserve metadata of existing directories
  26. -n, --seek Archive is seekable
  27. --occurrence[=NUMBER] process only the NUMth occurrence of each file in
  28. the archive. This option is valid only in
  29. conjunction with one of the subcommands --delete,
  30. --diff, --extract or --list and when a list of
  31. files is given either on the command line or via
  32. -T option. NUMBER defaults to 1.
  33. --overwrite overwrite existing files when extracting
  34. -O, --to-stdout extract files to standard output
  35. --recursive-unlink empty hierarchies prior to extracting directory
  36. --remove-files remove files after adding them to the archive
  37. -S, --sparse handle sparse files efficiently
  38. -U, --unlink-first remove each file prior to extracting over it
  39. -W, --verify attempt to verify the archive after writing it

  40. Handling of file attributes:

  41. --acls Save the ACLs to the archive
  42. --atime-preserve don't change access times on dumped files
  43. --group=NAME force NAME as group for added files
  44. --mode=CHANGES force (symbolic) mode CHANGES for added files
  45. -m, --touch don't extract file modified time
  46. --no-acls Don't extract the ACLs from the archive
  47. --no-same-owner extract files as yourself
  48. --no-same-permissions do not extract permissions information
  49. --no-selinux Don't extract the SELinux context from the archive

  50. --no-xattrs Don't extract the user/root xattrs from the
  51. archive
  52. --numeric-owner always use numbers for user/group names
  53. --owner=NAME force NAME as owner for added files
  54. -p, --preserve-permissions, --same-permissions
  55. extract permissions information
  56. --preserve same as both -p and -s
  57. --same-owner try extracting files with the same ownership
  58. -s, --preserve-order, --same-order
  59. sort names to extract to match archive
  60. --selinux Save the SELinux context to the archive
  61. --xattrs Save the user/root xattrs to the archive

  62. Device selection and switching:

  63. -f, --file=ARCHIVE use archive file or device ARCHIVE
  64. --force-local archive file is local even if has a colon
  65. -F, --info-script=NAME, --new-volume-script=NAME
  66. run script at end of each tape (implies -M)
  67. -L, --tape-length=NUMBER change tape after writing NUMBER x 1024 bytes
  68. -M, --multi-volume create/list/extract multi-volume archive
  69. --rmt-command=COMMAND use given rmt COMMAND instead of rmt
  70. --rsh-command=COMMAND use remote COMMAND instead of rsh
  71. --volno-file=FILE use/update the volume number in FILE

  72. Device blocking:

  73. -b, --blocking-factor=BLOCKS BLOCKS x 512 bytes per record
  74. -B, --read-full-records reblock as we read (for 4.2BSD pipes)
  75. -i, --ignore-zeros ignore zeroed blocks in archive (means EOF)
  76. --record-size=NUMBER SIZE bytes per record, multiple of 512

  77. Archive format selection:

  78. -H, --format=FORMAT create archive of the given format.

  79. FORMAT is one of the following:

  80. gnu GNU tar 1.13.x format
  81. oldgnu GNU format as per tar <= 1.12
  82. pax POSIX 1003.1-2001 (pax) format
  83. posix Same as pax
  84. ustar POSIX 1003.1-1988 (ustar) format
  85. v7 old V7 tar format

  86. -j, --bzip2 filter the archive through bzip2
  87. --old-archive, --portability
  88. same as --format=v7
  89. --pax-option=keyword[[:]=value][,keyword[[:]=value], ...]
  90. control pax keywords
  91. --posix same as --format=posix
  92. --use-compress-program=PROG
  93. filter through PROG (must accept -d)
  94. -V, --label=TEXT create archive with volume name NAME. At
  95. list/extract time, use TEXT as a globbing pattern
  96. -z, --gzip, --gunzip, --ungzip filter the archive through gzip
  97. -Z, --compress, --uncompress filter the archive through compress

  98. Local file selection:

  99. --after-date=DATE same as -N
  100. --anchored exclude patterns match file name start
  101. --backup[=CONTROL] backup before removal, choose version CONTROL
  102. -C, --directory=DIR change to directory DIR
  103. --exclude=PATTERN exclude files, given as a PATTERN
  104. --exclude-caches exclude directories containing a cache tag
  105. -h, --dereference dump instead the files symlinks point to
  106. --ignore-case exclusion ignores case
  107. -K, --starting-file=MEMBER-NAME
  108. begin at member MEMBER-NAME in the archive
  109. --newer-mtime=DATE compare date and time when data changed only
  110. --no-anchored exclude patterns match after any / (default)
  111. --no-ignore-case exclusion is case sensitive (default)
  112. --no-recursion avoid descending automatically in directories
  113. --no-wildcards exclude patterns are plain strings
  114. --no-wildcards-match-slash exclude pattern wildcards do not match '/'
  115. --null -T reads null-terminated names, disable -C
  116. -N, --newer=DATE-OR-FILE only store files newer than DATE-OR-FILE
  117. --one-file-system stay in local file system when creating archive
  118. -P, --absolute-names don't strip leading `/'s from file names
  119. --recursion recurse into directories (default)
  120. --strip-components=NUMBER strip NUMBER leading components from file
  121. names
  122. --suffix=STRING backup before removal, override usual suffix ('~'
  123. unless overridden by environment variable
  124. SIMPLE_BACKUP_SUFFIX
  125. -T, --files-from=FILE-OF-NAMES get names to extract or create from file
  126. NAME
  127. --wildcards exclude patterns use wildcards (default)
  128. --wildcards-match-slash exclude pattern wildcards match '/' (default)
  129. -X, --exclude-from=FILE exclude patterns listed in FILE

  130. Informative output:

  131. --checkpoint display progress messages every 10th record
  132. -v, --verbose verbosely list files processed

  133. --check-links print a message if not all links are dumped
  134. --index-file=FILE send verbose output to FILE
  135. -R, --block-number show block number within archive with each
  136. message
  137. --show-defaults Show tar defaults
  138. --show-omitted-dirs When listing or extracting, list each directory
  139. that does not match search criteria
  140. --totals print total bytes written while creating archive
  141. --utc print file modification dates in UTC
  142. -w, --interactive, --confirmation
  143. ask for confirmation for every action

  144. Compatibility options:

  145. --allow-name-mangling when creating, allow GNUTYPE_NAMES mangling --
  146. considered dangerous
  147. -o when creating, same as --old-archive. When
  148. extracting, same as --no-same-owner

  149. Other options:

  150. -?, --help Give this help list
  151. --license Print license and exit
  152. --usage Give a short usage message
  153. --version Print program version

  154. Mandatory or optional arguments to long options are also mandatory or optional
  155. for any corresponding short options.

  156. The backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.
  157. The version control may be set with --backup or VERSION_CONTROL, values are:

  158. t, numbered make numbered backups
  159. nil, existing numbered if numbered backups exist, simple otherwise
  160. never, simple always make simple backups

  161. *This* tar defaults to:
  162. --format=gnu -f- -b20 --rmt-command=/sbin/rmt --rsh-command=/usr/bin/rsh

  163. Report bugs to bug-tar@gnu.org.

  164. [root@localhost]#
复制代码

返回列表
Namecheap
Namecheap.com - Cheap domain name registration, renewal and transfers - Free SSL Certificates - Web Hosting
互联网安全