Skip to content

Find large or old attachments

Find where the big files are, list them, and clean up — page by page or across a space. du sums attachment sizes; attach find lists the files themselves.

$ du -h -s /DOCS
$ du -h /DOCS
$ du -h ./MySpace/Projects

du prints one line per page that has attachments, then a total. -s prints only the total; -h uses human sizes. Child pages and pages inside folders count toward the path you give.

$ attach find /DOCS -size +10M
$ attach find /DOCS -size +10M -ls
$ attach find ./MySpace -mtime +365 -name '*.zip'
$ attach find /DOCS --format csv
  • -size +10M = larger than 10 MiB (k, M, G are powers of 1024; the default unit is bytes).
  • -mtime +365 = file not updated for more than a year.
  • -ls shows size, date, version, media type, name, and path. --format csv prints a CSV you can copy into a spreadsheet.
$ attach find /DOCS -size +50M | attach rm -n
$ attach find /DOCS -size +50M | attach rm -y

Pipe the plain attach find output (not -ls / CSV). At most 100 files per run. Files go to the Confluence trash — there is no purge, so a space admin can still restore them.

  • Totals come from the Confluence search index: a just-uploaded file may be missing briefly, and archived spaces or pages you can’t see are not counted.
  • Page body size is not included in du.
  • No upload. To rename a file, use attach mv -y OLD NEW PAGE.
  • No new app permissions are used.