Making An Inventory Of A Hard Drive Or Directory

THL Toolbox > Miscellaneous Technical Processes > Making an Inventory of a Hard Drive or Directory

Making an Inventory of a Hard Drive or Directory

Contributor(s): Brad Aaron, Andres Montano, Steve Weinberger

In OS X, open terminal, navigate to the hard drive volume you want to catalog (cd volumes)

When you are in the root directory of the volume to be cataloged, type:

ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^/]*//--/g' -e 's/^/   /' -e 's/-/|/'

into the command line (copy and paste from here)

Then copy and paste the results of the directory index (which indexes the entire drive by directory, sub directories and files) into a new section below. Make sure to paste into the 'Wiki Markup' window and include the tags 

--------

around the pasted lists.

--------

How to find a list of all FCP files within a directory or volume on OS X *(limited usefulness since mac files are categorized by resource forks and not by file extensions, so some older files don't have the *.fcp file extension)*:

find /volumes/VOLUMENAME -name *fcp

How to get a list of all files of 'kind' Final Cut Pro Project File *(USE THIS METHOD)*:

  • Download and install the [PrintWindow|external link: http://www.searchwaresolutions.com/] application for OS X.
  • Open print window and hit Command + P to enter the "Print Folder Listing…" dialogue.
  • Navigate to the volume you want to get the file names from and click 'select'
  • Choose the icon that says "File"
  • Under the Layout tab select Style Excel File and under Folder Expansion section, "Expand all folders"
  • Then, under "Fields & Sorting" tab, check off all file information and check "Use Full Path for Name"
  • Click Save
  • Save the file and the app will begin to run. On a large volume it will take quite a while to go through all the folders.
  • When it's finished, you will have an excel spreadsheet with separate columns for the file name/path and other selected "file information". Sort this list by the "file information" for "kind" and then select the name/path for all Final Cut Pro Project Files

How to separate the file name from the path to add both path and file name to a spreadsheet for wrangling:

You need to do this in a text editor that supports Regular Expression searching. [Textmate|external link: http://macromates.com/] (proprietary software for Mac OS, oXygen, etc) For Windows, there is [Notepad RE|external link: http://www.codeproject.com/Articles/4600/Notepad-RE-Regular-Expressions] free text editor.

    Open a new file in the text editor
    Copy the column of data from the spreadsheet and paste it into the text editor file
    Select Regular Expression in the search-and-replace box
    $ In the Text to find box enter: ([^/]+)$
    In the Replace with box enter: $1t$1
    Press Replace all
    This will add a tab and then the filename for each row
    Copy this and paste it into 2 columns in the Excel doc

If the directory path uses backward slashes rather than forward slashes, in the Text to find box replace the forward slash with two back slashes.

After you have separated the filename from the path, you can copy and paste the corresponding column into the AV wrangling spreadsheet in the right location.

Provided for unrestricted use by the external link: Tibetan and Himalayan Library