Tree (command)

Last updated
tree
Developer(s) Steve Baker, DR, Microsoft, IBM, Itautec, Datalight, Toshiba, Dave Dunfield, Asif Bahrainwala
Written in 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
Type Command
License Unix, Unix-like, FreeDOS, ReactOS: GPLv2

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, [1] IBM/Toshiba 4690 OS, [2] PTS-DOS, [3] FreeDOS, [4] IBM OS/2, [5] Microsoft Windows, [6] and ReactOS. A version for Unix and Unix-like systems is also available.

Contents

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. [7]

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. [8]

The command is available in MS-DOS versions 3.2 and later and IBM PC DOS releases 2 and later. [9] Digital Research DR DOS 6.0, [10] Itautec SISNE plus, [11] and Datalight ROM-DOS [12] include an implementation of the tree command.

The Tree Command for Linux was developed by Steve Baker. [13] The FreeDOS version was developed by Dave Dunfield [14] and the ReactOS version was developed by Asif Bahrainwala. [15] 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. [16]

Example

$ treepath/to/folder/ path/to/folder/├── a-first.html├── b-second.html├── subfolder│   ├── readme.html│   ├── code.cpp│   └── code.h└── z-last-file.html1 directories, 6 files

See also

Related Research Articles

dir (command) Directory information command on various operating systems

In computing, dir (directory) is a command in various computer operating systems used for computer file and directory listing. It is one of the basic commands to help navigate the file system. The command is usually implemented as an internal command in the command-line interpreter (shell). On some systems, a more graphical representation of the directory structure can be displayed using the tree command.

mkdir Directory creation command on various operating systems

The mkdir command in the Unix, DOS, DR FlexOS, IBM OS/2, Microsoft Windows, and ReactOS operating systems is used to make a new directory. It is also available in the EFI shell and in the PHP scripting language. In DOS, OS/2, Windows and ReactOS, the command is often abbreviated to md.

In computing, rmdir is a command which will remove an empty directory on various operating systems.

fdisk Command line utility of DOS and Microsoft Windows operating systems

fdisk is a command-line utility for disk partitioning. It has been part of DOS, DR FlexOS, IBM OS/2, and early versions of Microsoft Windows, as well as certain ports of FreeBSD, NetBSD, OpenBSD, DragonFly BSD and macOS for compatibility reasons. Windows 2000 and its successors have replaced fdisk with a more advanced tool called diskpart.

In computing, touch is a command used to update the access date and/or modification date of a computer file or directory. It is included in Unix and Unix-like operating systems, TSC's FLEX, Digital Research/Novell DR DOS, the AROS shell, the Microware OS-9 shell, and ReactOS. The command is also available for FreeDOS and Microsoft Windows.

more (command) Terminal pager available on various operating systems

In computing, more is a command to view the contents of a text file one screen at a time. It is available on Unix and Unix-like systems, DOS, Digital Research FlexOS, IBM/Toshiba 4690 OS, IBM OS/2, Microsoft Windows and ReactOS. Programs of this sort are called pagers. more is a very basic pager, originally allowing only forward navigation through a file, though newer implementations do allow for limited backward movement.

In computing, sleep is a command in Unix, Unix-like and other operating systems that suspends program execution for a specified time.

In computing, share is a command for DOS that allows software to perform file locks. Locking files became necessary when MS-DOS began allowing files to be accessed simultaneously by multiple programs, either through multitasking or networking.

<span class="mw-page-title-main">ATTRIB</span>

In computing, ATTRIB is a command in Intel ISIS-II, DOS, IBM OS/2, Microsoft Windows and ReactOS that allows the user to change various characteristics, or "attributes" of a computer file or directory. The command is also available in the EFI shell.

del (command) Command in various operating systems

In computing, del is a command in command-line interpreters (shells) such as COMMAND.COM, cmd.exe, 4DOS, NDOS, 4OS2, 4NT and Windows PowerShell. It is used to delete one or more files or directories from a file system.

<span class="mw-page-title-main">PRINT (command)</span> Computing command

In computing, the print command provides single-user print spooling capability in a number of operating systems. It is roughly similar to that provided by the UNIX System V lp and BSD lpr print spooler systems.

find (Windows)

In computing, find is a command in the command-line interpreters (shells) of a number of operating systems. It is used to search for a specific text string in a file or files. The command sends the specified lines to the standard output device.

help (command) Command in various command line shells

In computing, help is a command in various command line shells such as COMMAND.COM, cmd.exe, Bash, qshell, 4DOS/4NT, Windows PowerShell, Singularity shell, Python, MATLAB and GNU Octave. It provides online information about available commands and the shell environment.

copy (command)

In computing, copy is a command in various operating systems. The command copies computer files from one directory to another.

In Unix-like operating systems, a device file, device node, or special file is an interface to a device driver that appears in a file system as if it were an ordinary file. There are also special files in DOS, OS/2, and Windows. These special files allow an application program to interact with a device by using its device driver via standard input/output system calls. Using standard system calls simplifies many programming tasks, and leads to consistent user-space I/O mechanisms regardless of device features and functions.

format (command)

In computing, format is a command-line utility that carries out disk formatting. It is a component of various operating systems, including 86-DOS, MS-DOS, IBM PC DOS and OS/2, Microsoft Windows and ReactOS.

In computing, diskcopy is a command used on a number of operating systems for copying the complete contents of a diskette to another diskette.

In computing, recover is a primitive file system error recovery utility included in MS-DOS / IBM PC DOS versions prior to DOS 6.0 and a number of other operating systems.

In computing, diskcomp is a command used for comparing the complete contents of a floppy disk to another one.

The command-line tool exe2bin is a post-compilation utility program available on MS-DOS and other operating systems.

References

  1. FlexOS User's Guide (PDF) (Version 1.3 ed.). Digital Research. November 1986. 1073-2003-001. Archived from the original (PDF) on 2019-09-25. Retrieved 2018-09-16.
  2. "Users Guide". archive.org.[ dead link ]
  3. "PTS-DOS 2000 Pro User Manual" (PDF). Buggingen, Germany: Paragon Technology GmbH. 1999. Archived (PDF) from the original on 2018-05-12. Retrieved 2018-05-12.
  4. "FreeDOS group -- FreeDOS Base". FreeDOS on ibiblio.org.
  5. "JaTomes Help - OS/2 Commands". Archived from the original on 2019-04-14. Retrieved 2019-07-27.
  6. "Tree". Microsoft Docs. 3 February 2023.
  7. "The World of the Technical Support Scam". The State of Security. 2016-11-09. Retrieved 2019-12-29.
  8. tree(1)    Linux User Commands Manual
  9. Wolverton, Van (2003). Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition. Microsoft Press. ISBN   0-7356-1812-7.
  10. DR DOS 6.0 User Guide Optimisation and Configuration Tips
  11. Itautec (2015-05-14). "SISNE plus - Referência Sumária" [SISNE plus - Quick Reference Manual]. Datassette (in Portuguese). COD 23987-01-4. Archived from the original on 2019-09-28. Retrieved 2020-01-12. (86 pages)
  12. "Datalight ROM-DOS User's Guide" (PDF). www.datalight.com.
  13. Baker, Steve. "Home - Old Man Programmer" . Retrieved 2024-01-26.
  14. "FreeDOS Package -- Tree (FreeDOS Base)". FreeDOS on ibiblio.org.
  15. tree.c on GitHub
  16. "Homebrew - Tree (Formala)". Homebrew. Retrieved 2024-05-14.

Further reading