How do I move Confluence pages from a command line?
Shell for Confluence is a free, bash-like console for managing Confluence content. It maps your site to a filesystem: / is the site root, followed by spaces and their pages.
The first time you open the console, welcome tips suggest trying tree, find -mtime, and ls --format csv.
Can I move several pages at once?
Section titled “Can I move several pages at once?”Yes. Add multiple source pages to one mv command:
$ mv pageA pageB pageC destParentAll pages must be in the same space. You can pass several named sources, use * or ? in the last segment of each source path on the command line (not on DEST; not from piped stdin), or pipe from find:
$ mv Draft* ./Archive$ find . -name '*2023*' | mv -n ./Archive$ find . -name '*2023*' | mv ./ArchiveAt most 100 sources. Zero glob matches is an error. If one source fails, Shell keeps the successful moves. There is no Bulk multi-select panel — use globs, multiple argv sources, or find | mv.
Can I search for pages and then move them?
Section titled “Can I search for pages and then move them?”Yes. Find or filter pages, then move or copy the named pages within the same space.
- Find pages with
find. You can use-name PATTERN,-maxdepth N,-mtime [+|-]N(last update, not created; spaces never match), or-prune(print a match and do not descend — useful with-mtimebeforemv -n). Press Esc or Ctrl+C to stop a long search. The search index used by-mtimemay lagls -lright after edits. - Filter paths with
find | grep …orls | grep …. - Pass the page names to
mvorcp, or pipe the paths fromfindorgrep.
These commands move and copy pages. They don’t replace text in page titles or content.
How is find … -exec grep different from find | grep?
Section titled “How is find … -exec grep different from find | grep?”find | grepfilters paths in the results.find … -exec grep PATTERNsearches page content in the page tree.
Can I inspect page history?
Section titled “Can I inspect page history?”Yes. Use checkout (or its alias, restore) to list recent versions or restore a previous version. The restored version becomes the current version.
Are personal spaces included?
Section titled “Are personal spaces included?”Yes. At /, ls and tab completion include personal and global spaces. Archived spaces aren’t shown. Use cd to open a personal space just as you would any other space.
Can I print an ASCII page tree?
Section titled “Can I print an ASCII page tree?”Yes. Use tree [PATH] [-L N] (or --maxdepth N / -maxdepth N). Default PATH is .; default depth is 3. Output uses classic box-drawing characters with space and page titles. Caps and interrupt (Esc / Ctrl+C) follow the same spirit as find. This is a visual listing — not a bulk tree migrator, and there is no Bulk multi-select panel UI.
Can I list, delete, or rename attachments?
Section titled “Can I list, delete, or rename attachments?”Yes, for page attachments with attach (not uploads). List with attach ls [PAGE]. Delete moves an attachment to trash: attach rm -y NAME [PAGE]. Rename: attach mv -y OLD NEW [PAGE]. Writes need -y. There is no upload or purge.
Can I define command shortcuts?
Section titled “Can I define command shortcuts?”Yes. alias name=command saves a shortcut in your browser, and unalias name removes it. An alias can’t replace a built-in command name.
Can I change who can view or edit a page?
Section titled “Can I change who can view or edit a page?”Yes, with chmod. It lists or changes explicit Confluence page restrictions (view / edit) for users and groups. It is not Unix modes (no 755 / u-g-o bits). There is no chown in this release.
- Preview with
-n/--dry-run. Writes require-y/--yes. - Examples:
chmod PATH,chmod -y read=+u:ACCOUNTID PATH,chmod -y clear PATH(pipes intochmodare supported where the console already pipes into other commands). - If a multi-action run fails partway, the result says what was partially applied (it does not silently half-apply).
- Space-level permissions and recursive (
-R) changes are out of scope. No new Forge scopes were added for this feature.
What commands are available?
Section titled “What commands are available?”Navigation: ls, ls -l (pages: id status vN owner date title url; root spaces: type status id owner created name url), ls --format csv / ls --format=csv (header + RFC 4180; UTC ISO; terminal output, no >), cd, pwd. Discover: find (-name / -maxdepth / -mtime / -prune; -exec grep for page bodies), tree (ASCII page tree; -L / --maxdepth; default depth 3). Organize: mv, cp (glob */? on source argv; max 100), rm / del (requires -y), touch / mkdir. Attachments: attach ls, attach rm -y, attach mv -y (page attachments; trash only). Page restrictions: chmod. Inspect and process: cat, open, echo, head, tail, less, grep, wc, sort. History: checkout / restore. Help: help, help <command>, help |, help ^. Pipes: ls | grep …, find | grep …, find … | mv DEST, find … | cp DEST, find … | less, cat path | head. Body search: find … -exec grep PATTERN. Shortcuts: alias, unalias (persisted in this browser). Themes: theme, theme font, theme size, theme height (persisted in this browser).
User guide: /shell-for-confluence-cloud/guide-for-users/
Use cases: /shell-for-confluence-cloud/guide-for-users/use-cases/
Overview (no install counts): Shell for Confluence intro