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.
1. See which pages hold the most
Section titled “1. See which pages hold the most”$ du -h -s /DOCS$ du -h /DOCS$ du -h ./MySpace/Projectsdu 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.
2. List large or old files
Section titled “2. List large or old files”$ 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,Gare powers of 1024; the default unit is bytes).-mtime +365= file not updated for more than a year.-lsshows size, date, version, media type, name, and path.--format csvprints a CSV you can copy into a spreadsheet.
3. Preview, then move files to trash
Section titled “3. Preview, then move files to trash”$ attach find /DOCS -size +50M | attach rm -n$ attach find /DOCS -size +50M | attach rm -yPipe 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.