list.rst.inc 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. .. IMPORTANT: this file is auto-generated from borg's built-in help, do not edit!
  2. .. _borg_list:
  3. borg list
  4. ---------
  5. .. code-block:: none
  6. borg [common options] list [options] NAME [PATH...]
  7. .. only:: html
  8. .. class:: borg-options-table
  9. +-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  10. | **positional arguments** |
  11. +-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  12. | | ``NAME`` | specify the archive name |
  13. +-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  14. | | ``PATH`` | paths to list; patterns are supported |
  15. +-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  16. | **options** |
  17. +-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | | ``--short`` | only print file/directory names, nothing else |
  19. +-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | | ``--format FORMAT`` | specify format for file listing (default: "{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}") |
  21. +-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | | ``--json-lines`` | Format output as JSON Lines. The form of ``--format`` is ignored, but keys used in it are added to the JSON output. Some keys are always present. Note: JSON can only represent text. |
  23. +-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | | ``--depth N`` | only list files up to the specified directory level depth |
  25. +-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | .. class:: borg-common-opt-ref |
  27. | |
  28. | :ref:`common_options` |
  29. +-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | **Include/Exclude options** |
  31. +-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. | | ``-e PATTERN``, ``--exclude PATTERN`` | exclude paths matching PATTERN |
  33. +-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  34. | | ``--exclude-from EXCLUDEFILE`` | read exclude patterns from EXCLUDEFILE, one per line |
  35. +-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  36. | | ``--pattern PATTERN`` | include/exclude paths matching PATTERN |
  37. +-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | | ``--patterns-from PATTERNFILE`` | read include/exclude patterns from PATTERNFILE, one per line |
  39. +-------------------------------------------------------+---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. .. raw:: html
  41. <script type='text/javascript'>
  42. $(document).ready(function () {
  43. $('.borg-options-table colgroup').remove();
  44. })
  45. </script>
  46. .. only:: latex
  47. NAME
  48. specify the archive name
  49. PATH
  50. paths to list; patterns are supported
  51. options
  52. --short only print file/directory names, nothing else
  53. --format FORMAT specify format for file listing (default: "{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}")
  54. --json-lines Format output as JSON Lines. The form of ``--format`` is ignored, but keys used in it are added to the JSON output. Some keys are always present. Note: JSON can only represent text.
  55. --depth N only list files up to the specified directory level depth
  56. :ref:`common_options`
  57. |
  58. Include/Exclude options
  59. -e PATTERN, --exclude PATTERN exclude paths matching PATTERN
  60. --exclude-from EXCLUDEFILE read exclude patterns from EXCLUDEFILE, one per line
  61. --pattern PATTERN include/exclude paths matching PATTERN
  62. --patterns-from PATTERNFILE read include/exclude patterns from PATTERNFILE, one per line
  63. Description
  64. ~~~~~~~~~~~
  65. This command lists the contents of an archive.
  66. For more help on include/exclude patterns, see the :ref:`borg_patterns` command output.
  67. .. man NOTES
  68. The FORMAT specifier syntax
  69. +++++++++++++++++++++++++++
  70. The ``--format`` option uses python's `format string syntax
  71. <https://docs.python.org/3.9/library/string.html#formatstrings>`_.
  72. Examples:
  73. ::
  74. $ borg list --format '{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}' ArchiveFoo
  75. -rw-rw-r-- user user 1024 Thu, 2021-12-09 10:22:17 file-foo
  76. ...
  77. # {VAR:<NUMBER} - pad to NUMBER columns left-aligned.
  78. # {VAR:>NUMBER} - pad to NUMBER columns right-aligned.
  79. $ borg list --format '{mode} {user:>6} {group:>6} {size:<8} {mtime} {path}{extra}{NL}' ArchiveFoo
  80. -rw-rw-r-- user user 1024 Thu, 2021-12-09 10:22:17 file-foo
  81. ...
  82. The following keys are always available:
  83. - NEWLINE: OS dependent line separator
  84. - NL: alias of NEWLINE
  85. - NUL: NUL character for creating print0 / xargs -0 like output
  86. - SPACE: space character
  87. - TAB: tab character
  88. - CR: carriage return character
  89. - LF: line feed character
  90. Keys available only when listing files in an archive:
  91. - type: file type (file, dir, symlink, ...)
  92. - mode: file mode (as in stat)
  93. - uid: user id of file owner
  94. - gid: group id of file owner
  95. - user: user name of file owner
  96. - group: group name of file owner
  97. - path: file path
  98. - target: link target for symlinks
  99. - hlid: hard link identity (same if hardlinking same fs object)
  100. - flags: file flags
  101. - size: file size
  102. - num_chunks: number of chunks in this file
  103. - mtime: file modification time
  104. - ctime: file change time
  105. - atime: file access time
  106. - isomtime: file modification time (ISO 8601 format)
  107. - isoctime: file change time (ISO 8601 format)
  108. - isoatime: file access time (ISO 8601 format)
  109. - blake2b
  110. - blake2s
  111. - md5
  112. - sha1
  113. - sha224
  114. - sha256
  115. - sha384
  116. - sha3_224
  117. - sha3_256
  118. - sha3_384
  119. - sha3_512
  120. - sha512
  121. - xxh64: XXH64 checksum of this file (note: this is NOT a cryptographic hash!)
  122. - archiveid: internal ID of the archive
  123. - archivename: name of the archive
  124. - extra: prepends {target} with " -> " for soft links and " link to " for hard links