LinuxCommandLibrary

treemd

Generate directory trees in markdown format

TLDR

Generate markdown tree

$ treemd
copy
For specific directory
$ treemd [path/to/directory]
copy
Exclude patterns
$ treemd -e "[node_modules,*.log]"
copy
Limit depth
$ treemd -d [2]
copy
Output to file
$ treemd > [tree.md]
copy

SYNOPSIS

treemd [-e patterns] [-d depth] [options] [path]

DESCRIPTION

treemd generates directory tree representations formatted as markdown, making it easy to include project structure documentation in README files and other markdown documents. The output uses markdown-compatible indentation and formatting that renders correctly on platforms like GitHub.
Patterns can be excluded to skip directories like node_modules or build artifacts that clutter the tree output. Depth limiting controls how many levels deep the tree displays, keeping documentation focused on the relevant structure.
The output can be redirected to a file or piped into other commands for integration into documentation workflows.

PARAMETERS

-e PATTERNS

Exclude patterns.
-d DEPTH
Maximum depth.
-f
Include files.
--help
Show help.

CAVEATS

Various implementations. Output format varies. Check version.

HISTORY

treemd tools generate directory structure as markdown, useful for documentation and README files.

SEE ALSO

tree(1), tre(1), find(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community