Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MarMorr

macrumors newbie
Original poster
May 30, 2014
2
0
I have many external hard drives (Firewire mostly) that have archived video projects and files. I need to make a text file that shows all files and their paths on each external hard disk making a different text file for each external disk. The purpose is to be able to search these text files without the external hard disks being mounted. These text files hopefully will show which external disk has the searched file and the path it takes on the disk. I have found one terminal command line but it doesn't work for me. This is it:

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

This was supposed to make the list in Terminal which could be copy/pasted into a text doc for searching but it doesn't work for me.

Is it possible to inventory an external hard drive?
Suggestions??
 
Look at the Terminal commands at the bottom of this page that will print folder contents to a text file on your Desktop that would be searchable. You will need to specify the path to the external Volume and run this for each drive.
 
I have many external hard drives (Firewire mostly) that have archived video projects and files. I need to make a text file that shows all files and their paths on each external hard disk making a different text file for each external disk. The purpose is to be able to search these text files without the external hard disks being mounted. These text files hopefully will show which external disk has the searched file and the path it takes on the disk. I have found one terminal command line but it doesn't work for me. This is it:

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

This was supposed to make the list in Terminal which could be copy/pasted into a text doc for searching but it doesn't work for me.

Is it possible to inventory an external hard drive?
Suggestions??

How many files are there in total on all disks? A text file is linear, searching it will be very slow if there is a lot of files on it, as an example my main OS X disk has 1011136 files on it. And how are you suppose to keep those text files in sync with all your disks? You will have to update them as soon as you add or remove a file.

Have you considered using Spotlight to index your disks?
 
Got it

That worked, thanks a million.

Just an FYI - As a video professional I have thousands of video clips. Some are finished masters, some are raw video clips, some are just graphic's such as logos and still pictures. My goal was to search for a particular clip or graphic but not knowing which of the dozens of archive hard drives to search was daunting. This way I just search the text file for the name and it gives me the Volume and path, SWEET.

THX
 
That worked, thanks a million.

Just an FYI - As a video professional I have thousands of video clips. Some are finished masters, some are raw video clips, some are just graphic's such as logos and still pictures. My goal was to search for a particular clip or graphic but not knowing which of the dozens of archive hard drives to search was daunting. This way I just search the text file for the name and it gives me the Volume and path, SWEET.

THX

If you don't have more files than that then I guess it could be manageable, but flat databases belongs in the 1960's. :)
 
How many files are there in total on all disks? A text file is linear, searching it will be very slow if there is a lot of files on it, as an example my main OS X disk has 1011136 files on it. And how are you suppose to keep those text files in sync with all your disks? You will have to update them as soon as you add or remove a file.

Have you considered using Spotlight to index your disks?

Guess you can delete the text file and re-run the command once you add new videos.

Personally, I would use a database to store this data. Create a few columns: row_id, file name, file path, volume name

Create an automator function to run when a disk is plugged in to scan the disk. If it finds a new file, it adds a new row. If a file is not found, it removes it from the DB.
 
Guess you can delete the text file and re-run the command once you add new videos.

Personally, I would use a database to store this data. Create a few columns: row_id, file name, file path, volume name

Create an automator function to run when a disk is plugged in to scan the disk. If it finds a new file, it adds a new row. If a file is not found, it removes it from the DB.

Yes, but when your disk has over a million files, it takes a lot of time, then add several disks.. I agree about the DB but Spotlight already uses one.
 
Yes, but when your disk has over a million files, it takes a lot of time, then add several disks.. I agree about the DB but Spotlight already uses one.

Spotlight usually stores its index on the indexed disk itself. This wouldn't meet the OP's requirement:
The purpose is to be able to search these text files without the external hard disks being mounted.​
 
Yes, but when your disk has over a million files, it takes a lot of time, then add several disks.. I agree about the DB but Spotlight already uses one.

yes, but spotlight only works when the drive is attached. Using a DB with a front end to do the search will always work and be available.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.