LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to traverse a directory with certain permissions? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-traverse-a-directory-with-certain-permissions-889142/)

wringer 06-30-2011 03:30 AM

How to traverse a directory with certain permissions?
 
Hi,

I'm trying to create a script that when given a directory, it goes traverses through all the subdirectories and process the files in them.
However, there is one restriction. The directories that it traverses through must all have a read permission for the others group.
How would I go about doing this?

Thanks! :)

unSpawn 06-30-2011 05:06 AM

If '/path/to/process' can find files to process on its own in a given subdirectory you could try 'find /path/to/directory -type d -perm -o=r -print0|xargs -0 -iX /path/to/process 'X';' and see 'man find' for more nfo wrt these options. Note when posting it's always good to show what you have tried yourself so we can see where you failed and help you from there (efficiency).


All times are GMT -5. The time now is 09:43 PM.