Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

If I do this in OS X, what is the maximum amount of files I can test?

Or is there a maximum length for this string?

do shell script "md5 -q 'path/to/file1.txt' 'path/to/file2.txt'"
share|improve this question

2 Answers 2

getconf ARG_MAX, or currently 262144 bytes.

If you get an argument list too long eror, try using find:

find . -type f -exec md5 -q {} \+

-exec md5 {} \+ and -print0 | xargs -0 md5 pass multiple arguments to md5, so they are usually faster than -exec md5 {} \;.

share|improve this answer

This will find all of the visible files within the folder.

set myFolder to POSIX path of (choose folder)
set myData to (do shell script "find " & quoted form of myFolder & " \\! -name \".*\" -type f -print0 | xargs -0 md5 -q")
share|improve this answer
    
Thanks I know nothing about unix. I have this old code which i copied somewhere and it needs tweaking (or tweaking of your code samples): do shell script "find -x " & my_path & " -print0 | xargs -0 ls -d -F -P -l -T -a -e -i -o -p -q " & my_path user name "user" password "pin" with administrator privileges Above code still don't get creation date & time. My ultimate goal is log with information below & number of Finder label & md5 & Finder comment, something like this: "46737077 drwxr-xr-x 2 Jonas 68 Oct 4 15:39:34 2012 /Users/Jonas/Desktop/test/test.txt 5 md5_here finder_comment_here" –  clueless5 Mar 22 '13 at 15:24
    
@clueless5 Maybe it's better to ask a new question for this specific topic and include the goal of the command or what you want to accomplish as well. The comment section is not a good place for such things. –  patrix Mar 23 '13 at 12:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.