Skip to content

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.

Yes. Add multiple source pages to one mv command:

$ mv pageA pageB pageC destParent

All 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 ./Archive

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

  1. 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 -mtime before mv -n). Press Esc or Ctrl+C to stop a long search. The search index used by -mtime may lag ls -l right after edits.
  2. Filter paths with find | grep … or ls | grep ….
  3. Pass the page names to mv or cp, or pipe the paths from find or grep.

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 | grep filters paths in the results.
  • find … -exec grep PATTERN searches page content in the page tree.

Yes. Use checkout (or its alias, restore) to list recent versions or restore a previous version. The restored version becomes the current version.

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.

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.

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.

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 into chmod are 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.

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