borg-list(1)

✨ borg-list(1) ✨

okay bestie, welcome to the borg backup tool corner of the internet, this is your girl explaining borg-list and yes we are gonna get along 🫢


πŸ’– NAME πŸ’–

borg-list β€” list what's actually inside a repository or an archive. like opening the bag and seeing everything in it, no cap πŸŽ€


🌸 SYNOPSIS 🌸

borg [common options] list [options] [REPOSITORY_OR_ARCHIVE] [PATH...]

πŸ¦‹ DESCRIPTION πŸ¦‹

This command lists the contents of a repository or an archive. That's it, that's the whole vibe. 🧚

Need more tea on include/exclude patterns? Run the borg_patterns command output, it spills everything.


πŸ‘‘ OPTIONS πŸ‘‘

See borg-common(1) for the common options every Borg command shares, bestie.

πŸ“ arguments

  • REPOSITORY_OR_ARCHIVE β€” the repository or archive whose contents you wanna list out πŸ‘€
  • PATH β€” the paths you wanna list; patterns are supported, so go feral

πŸ’… options

  • --consider-checkpoints β€” show checkpoint archives in the repository contents list (default: hidden, so they're lowkey sneakily concealed 🫣)
  • --short β€” only print file/directory names, nothing else. minimalist queen behavior ✨
  • --format FORMAT β€” specify the format for the file or archive listing. Defaults are: for files "{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}"; for archives "{archive:<36} {time} [{id}]{NL}" πŸŽ€
  • --json β€” only valid for listing repository contents. Formats output as JSON. The form of --format gets ignored, but the keys you used in it still get added to the JSON output. Some keys are always present. Note: JSON can only represent text, so a "barchive" key is therefore not available 😭
  • --json-lines β€” only valid for listing archive contents. Formats output as JSON Lines. The form of --format gets ignored, but the keys you used in it still get added to the JSON output. Some keys are always present. Note: JSON can only represent text, so a "bpath" key is therefore not available 😭

🌈 Archive filters

  • -P PREFIX, --prefix PREFIX β€” only consider archive names starting with this prefix. (deprecated, so like… use with awareness πŸ’€)
  • -a GLOB, --glob-archives GLOB β€” only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see borg help patterns.
  • --sort-by KEYS β€” comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp
  • --first N β€” consider first N archives after other filters were applied
  • --last N β€” consider last N archives after other filters were applied

🌟 Include/Exclude options

  • -e PATTERN, --exclude PATTERN β€” exclude paths matching PATTERN
  • --exclude-from EXCLUDEFILE β€” read exclude patterns from EXCLUDEFILE, one per line
  • --pattern PATTERN β€” include/exclude paths matching PATTERN
  • --patterns-from PATTERNFILE β€” read include/exclude patterns from PATTERNFILE, one per line

πŸ”₯ EXAMPLES πŸ”₯

$ borg list /path/to/repo
Monday                               Mon, 2016-02-15 19:15:11
repo                                 Mon, 2016-02-15 19:26:54
root-2016-02-15                      Mon, 2016-02-15 19:36:29
newname                              Mon, 2016-02-15 19:50:19
...

$ borg list /path/to/repo::root-2016-02-15
drwxr-xr-x root   root          0 Mon, 2016-02-15 17:44:27 .
drwxrwxr-x root   root          0 Mon, 2016-02-15 19:04:49 bin
-rwxr-xr-x root   root    1029624 Thu, 2014-11-13 00:08:51 bin/bash
lrwxrwxrwx root   root          0 Fri, 2015-03-27 20:24:26 bin/bzcmp -> bzdiff
-rwxr-xr-x root   root       2140 Fri, 2015-03-27 20:24:22 bin/bzdiff
...

$ borg list /path/to/repo::root-2016-02-15 --pattern "- bin/ba*"
drwxr-xr-x root   root          0 Mon, 2016-02-15 17:44:27 .
drwxrwxr-x root   root          0 Mon, 2016-02-15 19:04:49 bin
lrwxrwxrwx root   root          0 Fri, 2015-03-27 20:24:26 bin/bzcmp -> bzdiff
-rwxr-xr-x root   root       2140 Fri, 2015-03-27 20:24:22 bin/bzdiff
...

$ borg list /path/to/repo::archiveA --format="{mode} {user:6} {group:6} {size:8d} {isomtime} {path}{extra}{NEWLINE}"
drwxrwxr-x user   user          0 Sun, 2015-02-01 11:00:00 .
drwxrwxr-x user   user          0 Sun, 2015-02-01 11:00:00 code
drwxrwxr-x user   user          0 Sun, 2015-02-01 11:00:00 code/myproject
-rw-rw-r-- user   user    1416192 Sun, 2015-02-01 11:00:00 code/myproject/file.ext
-rw-rw-r-- user   user    1416192 Sun, 2015-02-01 11:00:00 code/myproject/file.text
...

$ borg list /path/to/repo/::archiveA --pattern '+ re:\.ext$' --pattern '- re:^.*$'
-rw-rw-r-- user   user    1416192 Sun, 2015-02-01 11:00:00 code/myproject/file.ext
...

$ borg list /path/to/repo/::archiveA --pattern '+ re:.ext$' --pattern '- re:^.*$'
-rw-rw-r-- user   user    1416192 Sun, 2015-02-01 11:00:00 code/myproject/file.ext
-rw-rw-r-- user   user    1416192 Sun, 2015-02-01 11:00:00 code/myproject/file.text
...

πŸ’œ NOTES πŸ’œ

πŸŽ€ The FORMAT specifier syntax

The --format option uses Python's format string syntax <https://docs.python.org/3.10/library/string.html#formatstrings>. it's giving very flexible, very demure ✨

Examples:

$ borg list --format '{archive}{NL}' /path/to/repo
ArchiveFoo
ArchiveBar
...

# {VAR:NUMBER} - pad to NUMBER columns.
# Strings are left-aligned, numbers are right-aligned.
# Note: time columns except ``isomtime``, ``isoctime`` and ``isoatime`` cannot be padded.
$ borg list --format '{archive:36} {time} [{id}]{NL}' /path/to/repo
ArchiveFoo                           Thu, 2021-12-09 10:22:28 [0b8e9a312bef3f2f6e2d0fc110c196827786c15eba0188738e81697a7fa3b274]
$ borg list --format '{mode} {user:6} {group:6} {size:8} {mtime} {path}{extra}{NL}' /path/to/repo::ArchiveFoo
-rw-rw-r-- user   user       1024 Thu, 2021-12-09 10:22:17 file-foo
...

# {VAR:<NUMBER} - pad to NUMBER columns left-aligned.
# {VAR:>NUMBER} - pad to NUMBER columns right-aligned.
$ borg list --format '{mode} {user:>6} {group:>6} {size:<8} {mtime} {path}{extra}{NL}' /path/to/repo::ArchiveFoo
-rw-rw-r--   user   user 1024     Thu, 2021-12-09 10:22:17 file-foo
...

⭐ The following keys are always available:

  • NEWLINE: OS dependent line separator
  • NL: alias of NEWLINE
  • NUL: NUL character for creating print0 / xargs -0 like output, see barchive and bpath keys below
  • SPACE
  • TAB
  • CR
  • LF

⭐ Keys available only when listing archives in a repository:

  • archive: archive name interpreted as text (might be missing non-text characters, see barchive)
  • name: alias of "archive"
  • barchive: verbatim archive name, can contain any character except NUL
  • comment: archive comment interpreted as text (might be missing non-text characters, see bcomment)
  • bcomment: verbatim archive comment, can contain any character except NUL
  • id: internal ID of the archive
  • tam: TAM authentication state of this archive
  • start: time (start) of creation of the archive
  • time: alias of "start"
  • end: time (end) of creation of the archive
  • command_line: command line which was used to create the archive
  • hostname: hostname of host on which this archive was created
  • username: username of user who created this archive

⭐ Keys available only when listing files in an archive:

  • type
  • mode
  • uid
  • gid
  • user
  • group
  • path: path interpreted as text (might be missing non-text characters, see bpath)
  • bpath: verbatim POSIX path, can contain any character except NUL
  • source: link target for links (identical to linktarget)
  • linktarget
  • flags
  • size
  • csize: compressed size
  • dsize: deduplicated size
  • dcsize: deduplicated compressed size
  • num_chunks: number of chunks in this file
  • unique_chunks: number of unique chunks in this file
  • mtime
  • ctime
  • atime
  • isomtime
  • isoctime
  • isoatime
  • blake2b
  • blake2s
  • md5
  • sha1
  • sha224
  • sha256
  • sha384
  • sha3_224
  • sha3_256
  • sha3_384
  • sha3_512
  • sha512
  • xxh64: XXH64 checksum of this file (note: this is NOT a cryptographic hash!)
  • archiveid
  • archivename
  • extra: prepends {source} with " -> " for soft links and " link to " for hard links
  • health: either "healthy" (file ok) or "broken" (if file has all-zero replacement chunks)

🫢 SEE ALSO 🫢

borg-common(1), borg-info(1), borg-diff(1), borg-prune(1), borg-patterns(1)


πŸ’– Author πŸ’–

The Borg Collective πŸ‘‘


and that's the whole page bestie, you ate that πŸ“βœ¨ sourced from borg backup tool version borg-list(1), dated 2026-07-18 β€” go list something iconic, periodt πŸ’…πŸŒˆ

πŸ“¦ where this page comes from