Similar to file lists, a folder tree can help you understand how folders are organized and named. Possible uses include:
You can use shell commands to generate folder trees. There are options for displaying the files within a folder as well.
Before using shell commands, you should be familiar with viewing files in File Explorer (Windows) or Finder (Mac). If you are using a cloud-based storage application, such as Box, Google Drive, or Dropbox, you may need to install a free desktop application to access your files through File Explorer or Finder. Go to the application's website for details.
You also should be able to open a command-line shell at a certain directory. For instructions, see the Command line quick start page.
Display folder tree |
Display folder tree with files |
|||
---|---|---|---|---|
Terminal |
tree -d |
tree |
||
PowerShell or Command Prompt |
tree |
tree /F |
Use these links to view instructions for the following shells. Also consult the Command line quick start page if needed.
Before using tree commands on a Mac, install Homebrew and then Homebrew tree package: brew install tree
tree -d
to output the folder tree in the shell windowtree
to include folders and files in the outputNote: Enter tree --help
to see a list of other display options.
To output results in a TXT file (saved in the top-level directory), append a file name to the command: tree -d > tree.txt
The tree command is preinstalled and has two modifiers (switches) that allow you to customize how the folder tree is outputted. You can also export a folder tree to a file.
tree
to output the folder tree in the shell windowtree /F
to display files in the tree as well as folderstree /A
to output in ASCII/text characters (can be useful for importing into another program)Note: You can combine the base command tree
with both modifiers: tree /F /A
To output results in a TXT file (saved in the top-level directory), append a file name to the command: tree /A > tree.txt
Note: Text files output in a similar format regardless if the /A
modifier is used, but using it may yield a cleaner result.
Consultations are also available by request.
Megan O'Donnell, Research Data Services Lead
Heather Campbell, Head of Metadata Services