I need to get the number of directories that
- Can only be read and opened by the owner of the directory.
- Can only be opened by their group.
My current solution is this:
ls -la . | grep "^dr-x--x---" | wc -l
Is this correct? Or is there a more proper way to do this?