Relevance to filter symlinks from directories(folders) not working?

(imported topic written by MarkA.Stevens)

Given the following:

  1. find /usr -type d -perm /002 -ls

65890 24 drwxrwxrwx 2 oracle dba 20480 Nov 11 07:02 /usr/lib/oracle/xe/app/oracle/admin/XE/adump

  1. ls -ld /usr/tmp

lrwxrwxrwx 1 root root 10 Aug 11 2010 /usr/tmp -> …/var/tmp

  1. ls -ld /var/tmp

drwxrwxrwt 4 root root 4096 Nov 22 10:41 /var/tmp

  1. ls -ld /usr/tmp/.oracle

drwxrwxrwt 2 root root 4096 Nov 11 07:03 /usr/tmp/.oracle

Then I sort of understand that I get the following (because symlinks can be pointed to directories):

Q: (descendant folders of folder “/usr”) whose (other mask of mode of it as string contains “w”)

A: /usr/lib/oracle/xe/app/oracle/admin/XE/adump

A: /usr/tmp

A: /usr/tmp/.oracle

T: 200654521

But I don’t understand why I don’t get “/usr/lib/oracle/xe/app/oracle/admin/XE/adump” for the following:

Q: (descendant folders of folder “/usr”) whose (other mask of mode of it as string contains “w” and not exists symlink of it as string)

T: 18535147

… Mark

(imported comment written by MarkA.Stevens)

So I’ve been working on this and have the following, which gives me the symlink’d directory.

Q: ((descendant folders of folder “/usr”) whose (other mask of mode of it as string contains “w”)) whose (exists values of symlink it as string)

A: /usr/tmp

T: 863863

But, the inversion (not …) doesn’t give me the other two, AND it takes FOREVER (okay 3.4 minutes) to run.

Q: ((descendant folders of folder “/usr”) whose (other mask of mode of it as string contains “w”)) whose (not (exists values of symlink it as string))

T: 209193072

I’m still confused.

… Mark

(imported comment written by MarkA.Stevens)

I’m not sure I really want to know the hours I spent on this. I finally stumbled upon the solution to find the writeable directories that are NOT symbolic links (symlinks):

Q: ((descendant folders of folder “/usr”) whose (other mask of mode of it as string contains “w”)) whose (exists symlink it equals false)

A: /usr/lib/oracle/xe/app/oracle/admin/XE/adump

A: /usr/tmp/.oracle

T: 1417132

… Mark