Tree (command)

Shell command in various operating systems
title: "Tree (command)" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["external-dos-commands", "os/2-commands", "reactos-commands", "unix-file-system-related-software", "windows-commands"] description: "Shell command in various operating systems" topic_path: "technology/operating-systems" source: "https://en.wikipedia.org/wiki/Tree_(command)" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0
::summary Shell command in various operating systems ::
::data[format=table title="Infobox software"]
| Field | Value |
|---|---|
| name | tree |
| screenshot | ReactOS-0.4.13 tree command 667x434.png |
| caption | The ReactOS tree command |
| developer | Steve Baker, DR, Microsoft, IBM, Itautec, Datalight, Toshiba, Dave Dunfield, Asif Bahrainwala |
| programming language | Unix-like, FreeDOS, ReactOS: C |
| operating system | Unix, Unix-like, MS-DOS, PC DOS, FlexOS, SISNE plus, ROM-DOS, 4690 OS, PTS-DOS, OS/2, eComStation, ArcaOS, Windows, DR DOS, FreeDOS, ReactOS |
| platform | Cross-platform |
| genre | Command |
| license | Unix, Unix-like, FreeDOS, ReactOS: GPLv2 |
| :: |
| name = tree
| logo =
| screenshot = ReactOS-0.4.13 tree command 667x434.png
| screenshot size =
| caption = The ReactOS tree command
| developer = Steve Baker, DR, Microsoft, IBM, Itautec, Datalight, Toshiba, Dave Dunfield, Asif Bahrainwala
| released =
| latest release version =
| latest release date =
| programming language = Unix-like, FreeDOS, ReactOS: C
| operating system = Unix, Unix-like, MS-DOS, PC DOS, FlexOS, SISNE plus, ROM-DOS, 4690 OS, PTS-DOS, OS/2, eComStation, ArcaOS, Windows, DR DOS, FreeDOS, ReactOS
| platform = Cross-platform
| genre = Command
| license = Unix, Unix-like, FreeDOS, ReactOS: GPLv2
| website =
In computing, tree is a recursive directory listing command or program that produces a depth-indented listing of files. Originating in PC- and MS-DOS, it is found in Digital Research FlexOS, IBM/Toshiba 4690 OS, PTS-DOS,
FreeDOS, IBM OS/2, Microsoft Windows, and ReactOS. A version for Unix and Unix-like systems is also available.
The tree command is frequently used as part of a technical support scam, where the command is used to occupy the command prompt screen, while the scammer, pretending to be technical support, types additional text that is supposed to look like output of the command.
Overview
With no arguments, tree lists the files in the current directory. When directory arguments are given, tree lists all the files or directories found in the given directories each in turn. Upon completion of listing all files and directories found, tree returns the total number of files and directories listed. There are options to change the characters used in the output, and to use color output.
The command is available in MS-DOS versions 3.2 and later and IBM PC DOS releases 2 and later. Digital Research DR DOS 6.0, Itautec SISNE plus, and Datalight ROM-DOS include an implementation of the command.
The Tree Command for Linux was developed by Steve Baker. The FreeDOS version was developed by Dave Dunfield and the ReactOS version was developed by Asif Bahrainwala. All three implementations are licensed under the GNU General Public License.
The Tree command is also available in macOS as a formula installed via the command line Homebrew package manager.
Example
::code[lang=console] $ tree path/to/folder/ path/to/folder/ ├── a-first.html ├── b-second.html ├── subfolder │ ├── readme.html │ ├── code.cpp │ └── code.h └── z-last-file.html
1 directories, 6 files ::
References
References
- (November 1986). "FlexOS User's Guide". [[Digital Research]].
- (May 2024). "Users Guide".
- "FreeDOS group -- FreeDOS Base". FreeDOS on ibiblio.org.
- "JaTomes Help - OS/2 Commands".
- (3 February 2023). "Tree".
- (2016-11-09). "The World of the Technical Support Scam".
- {{man. 1. tree. die.net
- (2003). "Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition". [[Microsoft Press]].
- [https://www.4corn.co.uk/archive/docs/DR%20DOS%206.0%20User%20Guide-opt.pdf DR DOS 6.0 User Guide Optimisation and Configuration Tips]
- Itautec. (2015-05-14). "SISNE plus - Referência Sumária". Datassette.
- "Datalight ROM-DOS User's Guide".
- Baker, Steve. "Home - Old Man Programmer".
- "FreeDOS Package -- Tree (FreeDOS Base)". FreeDOS on ibiblio.org.
- {{GitHub. https://github.com/reactos/reactos/blob/master/base/applications/cmdutils/tree/tree.c
- "Homebrew - Tree (Formala)". Homebrew.
::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::