How to list all files with Finder Comment using unix?
This will do the trick:

 find . -xattrname com.apple.metadata:kMDItemFinderComment \
        -exec printf %s\\t {} \; \
        -exec mdls -name kMDItemFinderComment -raw {} \; \
        -exec echo \;


Breaking this down a little:


find looks through the current directory (.) (and everything "below") for files with an extended attribute (-xattrname) called com.apple.metadata:kMDItemFinderComment.
As it finds each file:


the first -exec argument uses printf to print out the file path and a tab (\t) character.
The second -exec runs mdls to read the actual comment.
The third -exec just prints out a newline (\n) character.



Note that the find command is recursive, so this solution will look through subdirectories as well.

If you require absolute paths then use find `pwd` instead of find .