Search code examples
linuxshellunixcsh

how to find directories without access permissions ?


Possible Duplicate:
Using `find -perm` to find when a permission is not set

I have a list of directories in which some do not have access permissions. How can I create an array so that it contains only accessible directories using csh.

My code looks like as follow :

set array = (`find $path_to directories -type d -name "*_xyz"`)

it gives me whole list of directories matches to _xyz extension including without access permissions dir as well but I dont want them to be in list.


Solution

  • set array = (`find . -type d -perm /g+x,o+x -name "*_xyz"`)
    

    with that -perm parameters it search only folders accessible by the owner or the group