Workbook on Digital Private Papers > Surveying collections

Capturing directory structures


Capturing the directory structure of an archive creates a record of the orginal order of digital materials accessioned by the repository. This can be achieved using screenshots, but generating a textual file allows the archivist to record all the information in one file that can be searched.

Capturing a directory tree in Microsoft Windows XP

Select Run from the Start menu

Selecting Run from the Windows Start menu

Type cmd into the dialogue box and click OK.

Run cmd

In the 'cmd' terminal type tree pathordirectory /a specifying the directory for which you'd like to generate a tree e.g. tree c:\ /a would generate a tree for the c:/.

Windows CMD with tree command

If you wanted to generate a tree, which included files as well as directories on the c:\, you would type tree c:\ /a /f and press return. Creating a directory tree for the entire c:\ can take some time, so you may prefer to specify a smaller section of the filesystem.

To output the results as a text file we need to append >myfilename.txt to the command:

Windows CMD tree command, output to text file

The resulting text file is saved in the working directory, which is C:\Documents and Settings\susan in the example above. The text file generated by our example looks like this:

example of output from Windows tree command

Capturing directory trees on Linux and Unix

  1. Open a terminal
  2. The command tree > tree.txt will list all subdirectories and files in the current working directory and output the result in a file named 'tree.txt' in the same directory.
  3. tree specifieddirectory will list all subdirectories and files in a specified directory.

In the following example we have asked for a tree of the deerpark directory to be placed on the user's Desktop:

View of the Linux XTerm with tree command

The file is placed on the desktop:

icon for tree.txt on KDE desktop

This is what the output of the command looks like:

sample output of tree command