Use cases
These recipes show how to combine Shell commands for common Confluence work. Each page walks through a scenario, the commands to run, and the limits that apply.
-
Reorganize pages — rename, copy, and move pages, including
find -namepipes intomv/cp -
Search and audit content — list a page tree, count pages, and search titles or page bodies
-
Manage page restrictions — list and change explicit view / edit restrictions with
chmod -
Recover previous versions — list history and restore a prior version with
checkout/restore -
Work faster — aliases,
^old^new, tab completion, and quoting -
Export page list as CSV — machine-readable children with
ls --format csv(RFC 4180); richerls -lfor human columns -
Find pages not updated recently — stale pages by last update with
find -mtime; optional-prunebeforemv -n(max 100) -
Find pages by name —
find -namedemo: youtu.be/pSerR_MbejE -
List page attachments —
attach lsdemo: youtu.be/DetSU-Tl2Dc -
List with details (
ls -l) — demo: youtu.be/jq0H0iubnDQ -
Page output with
less— demo: youtu.be/RlaeiJ2-kNc -
Shell theme —
themedemo: youtu.be/ML2gzbiiHQ0 -
Find with
-prune—find -prunedemo: youtu.be/N3lvCiCn56g -
Pipe
ls -l | less— demo: youtu.be/D445HGwnr2o -
Move selected Confluence pages to another parent — find by name or last update, then
mvto another parent (max 100; another space needs-y) -
Show a space as a page tree — hierarchy with
tree/tree -L 2(visual listing only) -
Space hygiene ops — see
tree, find stale withfind -mtime/-prune, export withls --format csv, then label, archive, ormv(max 100) -
Label stale pages for review —
find -mtime +365 -prune | label add needs-review -y, thenfind -label(max 100 per run) -
Archive stale pages —
find -mtime +730 -prune | archive -ninto Confluence native archive (Standard+; not Free; one page at a time; max 100) -
Find large or old attachments —
du -hper page,attach find -size +10M -ls/--format csv, then| attach rm -n(trash only) -
Copy a page tree —
cp -r -nthencp -r -y(attachments and labels included; max 200 pages)
For command syntax, see the command reference. For boundaries, see Limitations.