How can I browse the directories of an external drive even when it is not attached?
Based on the clarifications in the comments, you can do the following:

Create an index file

find /Volumes/YOUR-EXTERNAL-DRIVE -print &gt; ~/YOUR-EXTERNAL-DRIVE-index.txt


This will list all files/folders on the external drive and store the result in your home folder. 

Search for a file

grep THE-NAME-YOU-ARE-LOOKING-FOR ~/YOUR-EXTERNAL-DRIVE-index.txt


Partial names will work as well (and the external drive must not be attached for the search).