# man > folder(1mh)

---
type: CommandReference
command: folder
mode: man
section: 1mh
source: man-pages
---

## Quick Reference

- `folder` — Print current folder status
- `folder +inbox` — Change to inbox folder and set as current
- `folder -all` — List all top-level folders
- `folder -all -recurse` — List all folders recursively
- `folder -push +project` — Push current folder onto stack and switch to project
- `folder -pop` — Pop folder from stack and switch to it
- `folder -pack +inbox` — Compress message numbering in inbox
- `folders` — Equivalent to `folder -all`

## Name

folder, folders — set/list current nmh folder/message

## Synopsis

shell
folder [-help] [-version] [+folder] [msg] [-all | -noall] [-create | -nocreate]
       [-fast | -nofast] [-header | -noheader] [-recurse | -norecurse]
       [-total | -nototal] [-list | -nolist] [-push | -pop] [-pack | -nopack]
       [-print] [-verbose | -noverbose]
`folders` is equivalent to `folder -all`.

## Options

- `-help` — Display help
- `-version` — Show version
- `+folder` — Specify folder to become current (like `cd` in shell)
- `msg` — Specify message number to become current message of folder
- `-all`, `-noall` — List summary for each top-level folder; `folders` command implies `-all`
- `-create`, `-nocreate` — Allow or forbid creation of non-existent folder (default: ask if interactive, yes otherwise)
- `-fast`, `-nofast` — List only folder names (faster, no need to read folders)
- `-header`, `-noheader` — Show/hide column header (default: header only with `-all`)
- `-recurse`, `-norecurse` — Include sub-folders recursively (defeats speed of `-fast`)
- `-total`, `-nototal` — Show/hide total message and folder counts (default: total only with `-all`)
- `-list`, `-nolist` — List the folder stack (like `dirs`); default after `-push` or `-pop`
- `-push` — Push current folder onto stack and switch to `+folder` (or exchange if no folder given); like `pushd`
- `-pop` — Pop top of stack and set as current folder; like `popd`
- `-pack`, `-nopack` — Compress message numbering in folder, removing holes
- `-print` — Print current folder status (default unless `-list`, `-push`, or `-pop` given)
- `-verbose`, `-noverbose` — Show actions during `-pack`

## Examples

shell
# Show current folder status
folder

# Switch to inbox folder
folder +inbox

# List all top-level folders with totals
folder -all

# List all folders recursively
folder -all -recurse

# Push current folder onto stack and switch to project
folder -push +project

# Pop folder from stack
folder -pop

# Compact message numbers in current folder
folder -pack

# List only folder names quickly
folder -fast
## See Also

- [mhpath(1)](https://www.chedong.com/phpMan.php/man/mhpath/1/markdown)
- [refile(1)](https://www.chedong.com/phpMan.php/man/refile/1/markdown)
- [rmf(1)](https://www.chedong.com/phpMan.php/man/rmf/1/markdown)