recursive directory listing with ownership

i'm playing around with "ls" and "find" and am trying to get a print out of directories, with full path, (recursive) and their ownership.... without files or package contents (Mac .pkg or .mpkg files). I'd like it simply displayed without much/any extraneous info.

everything i've tried, and researched, either presents too much info or not enough. generally, this format would be ideal but i'm open to other ideas...

eg:

owner:group /directoryA/
owner:group /directoryA/directory1/
owner:group /directoryB/
owner:group /directoryB/directory1/
owner:group /directoryB/directory2/
owner:group /directoryB/directory2/directory1/

thanks!

Try this:

find . -ls | awk '{print $3,$5,$6,$11}' | grep "^d" | awk '{print $2,$3,$4}'

find <path> -type d -printf "%u:%g %p\n"

Pipe it into 'sort' if you need it sorted, as find usually doesn't do that.

---
find . -ls | awk '{print $3,$5,$6,$11}' | grep "^d" | awk '{print $2,$3,$4}'
---

awesome, thanks for the quick response! that's pretty darn close to what i was wanting...

it seems to not list directories with spaces in the name. "Address Book" is shortened to "Address".

thanks!

This should fix the problem with space(s) in filename

find . -ls | awk '{printf "%s %s %s ", $3, $5, $6; for (i = 11; i <= NF; i++) printf "%s ", $i; printf "\n"}' | grep "^d" | cut -c 12-

great, thanks!!!