Activity › Forums › Apple OS X › Drive Inventory
-
Drive Inventory
Posted by Mike Weiner on March 4, 2011 at 9:59 pmHello. For PC, ElegantPie offers a drive inventory solution: https://www.elegantpie.com/driveinventory-download.html
I’m looking for something like that for Mac. I’m getting to the point where I have a lot of harddrives and I want to create a searchable list when the drives are offline, for both media and other files. Has anyone come across anything that will do that?
Thanks,
MikeLorena Ospina replied 13 years, 2 months ago 6 Members · 9 Replies -
9 Replies
-
Chris Gordon
March 5, 2011 at 2:29 amYou can easily dump a listing of all of the files on a disk (or in a specific directory) with find. Something like the following will list all of the files in the current directory (and its children).
find . -type f -name "*" -exec ls -al {} \;You could then redirect this to a file and import into Excel (seems that’s a point of the referenced software) or just sort through the text file (grep, awk and sort are your friends). Of course this is very much the “unix way” and requires comfort at the command line.
Hope that helps.
-
Mike Weiner
March 7, 2011 at 7:18 pmyeah i have only entered one line on the command end, but will experiment with it as i learn things very quickly.
how would i go from your line above to exporting the information to a text file or to excel (for example). if it could go to excel, that is just as well.
thanks,
mike -
Chris Gordon
March 8, 2011 at 12:11 amThe following will dump the output to a csv file that can easily be pulled into excel. Specifically it’s dumping the following fields:
file owner, file size, date, filename (with full path)find . -type f -name "*" -exec ls -al {} \; | awk ' {print $3", "$5", "$6, $7, $8", "$9 }' > file.csvSo what is this really doing? I’m calling the “find” command to list all of the files in the current directory and lower then handing that to ls to print out the details on the file. This is then piped to awk to print out the specific fields I care about. Finally the output of awk is directed to a file named file.csv.
One of the great(est) powers of OS X is its UNIX underpinnings. It is very common in UNIX to take a number of different commands and string them together like this giving you a lot of power very quickly and easily. Learning the command line and more about UNIX can be a bit daunting, but once you do, you can unlock a whole new world of power and flexibility.
-
Mike Weiner
March 8, 2011 at 3:27 pmOk. So say I have a few harddrives hooked into my computer, and I only want to create a csv for one of them not all of them, how do i go about that? I assume in terminal my command lines should look like:
find . -type f -name “*” -exec ls -al {} \; find . -type f -name “*” -exec ls -al {} \; | awk ‘ {print $3″, “$5”, “$6, $7, $8”, “$9 }’ > file.csv
Thanks!
-
Jerry Jorgenson
March 9, 2011 at 1:47 pmcd /drive mount point that you want to inventory.
find . -type f -exec ls -al {} \; | awk ‘ {print $3″, “$5”, “$6, $7, $8”, “$9 }’ > file_for_drive_1.csv
Note that using -type f will get all the files so -name “*” is redundant in this case.
If you don’t want the hidden files use -exec ls -l rather than -exec ls -la
If you wanted to put them all in the same file, just change > to >> The >> is append.
-
Craig Alan
March 12, 2011 at 5:52 pmhttps://www.squarebox.co.uk/standalone.html
raves from media content pros
OSX 10.5.8; MacBookPro4,1 Intel Core 2 Duo 2.5 GHz
; Camcorders: Sony Z7U, Canon HV30/40, Sony vx2000/PD170; FCP certified; write professionally for a variety of media; teach video production in L.A. -
Rich Rubasch
March 27, 2011 at 2:41 amOMG all that code was hurting my head. DiskCatalog Maker is what I have used since 2001. Cheap, simple, elegant. perfect.
Rich Rubasch
Tilt Media Inc.
Video Production, Post, Studio Sound Stage
Founder/President/Editor/Designer/Animator
https://www.tiltmedia.com -
Mike Weiner
March 27, 2011 at 8:17 pmRich —
and this will allow me to create a searchable list of all the files on a drive? What about a drive that is not currently mounted?
and does it do all types of files?
I assume you are talking about this software on this website: https://diskcatalogmaker.com/
Thanks,
Mike -
Lorena Ospina
March 6, 2013 at 5:11 pmDoes anyone know if there is a miraculous software like Disk Catalog Maker that is available for both Mac and PC. Where I can share my catalogs with both platforms?
Thank You!!!
L.
Reply to this Discussion! Login or Sign Up