Every file and folder

What is best way to get every file and folder including invisibles in “Macintosh HD:”?

I need to get path of file/folder and file name with extension and creation date/time and modification date/time and md5.


System Events or /usr/bin/find.

To gather all that data can take a very long time

I can’t find any reference for MD5 in manual of find.

Typically, UNIX command line tools are not of the all-in-one variety. Usually, one combines several tools to accomplish a task. First, use a shell (probably bash) to control how the tools are combined. Then use find to generate a list of files. Use xargs to combine the file names with an MD5 tool. The stock part of my system has two MD5 tools: /sbin/md5, and /usr/bin/openssl md5.

find ‘/Volumes/Macintosh HD/’ [.] -print0 | xargs -0 md5

Most UNIX system have no notion of a “creation time” for a file. They do have a “last inode Change time” which is often confused for creation because most one character references to it use ˜c’ (e.g. ctime). The manpage for the stat command on my system says it supports a “birth time” along with the usual access, modification and (inode) change times, but the program complains when I try to use it. Maybe it actually works on Leopard. If it does not work on your system you will need to find (or write) some other tool that can extract the “creation date/time”.

find ‘/Volumes/Macintosh HD/’ [.] -print0 | xargs -0 stat -f ‘%B %m %N’

The above command should print out the raw (seconds since the UNIX epoch) “birth” and modification time of each file/dir that find reports. Other time formats are available (see the manpage). You may have problems programatically parsing the output if any of your filenames have newlines.

If you want to avoid find having to traverse the entire volume for both commands you can use the shell to save a copy of find’s output and feed it back in to both variations of xargs.

Model: iBook G4 933
AppleScript: 1.10.7
Browser: Safari 4.0.2 (4530.19)
Operating System: Mac OS X (10.4)