DOKK / manpages / debian 11 / borgbackup / borg-list.1.en
BORG-LIST(1) borg backup tool BORG-LIST(1)

borg-list - List archive or repository contents

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

This command lists the contents of a repository or an archive.

See the "borg help patterns" command for more help on exclude patterns.

See borg-common(1) for common options of Borg commands.

repository or archive to list contents of
paths to list; patterns are supported

only print file/directory names, nothing else
specify format for file listing (default: "{mode} {user:6} {group:6} {size:8d} {mtime} {path}{extra}{NL}")
Only valid for listing repository contents. Format output as JSON. 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. A "barchive" key is therefore not available.
--json-lines
Only valid for listing archive contents. 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. A "bpath" key is therefore not available.

only consider archive names starting with this prefix.
only consider archive names matching the glob. sh: rules apply, see "borg help patterns". --prefix and --glob-archives are mutually exclusive.
Comma-separated list of sorting keys; valid keys are: timestamp, name, id; default is: timestamp
consider first N archives after other filters were applied
consider last N archives after other filters were applied

exclude paths matching PATTERN
read exclude patterns from EXCLUDEFILE, one per line
experimental: include/exclude paths matching PATTERN
experimental: read include/exclude patterns from PATTERNFILE, one per line

$ 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
...


The following keys are available for --format:

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

Keys for listing repository archives:

  • 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
  • start: time (start) of creation of the archive
  • time: alias of "start"
  • end: time (end) of creation of the archive
  • hostname: hostname of host on which this archive was created
  • username: username of user who created this archive

Keys for listing archive files:

  • 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
  • shake_128
  • shake_256
  • 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)

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

The Borg Collective

2021-03-22