LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-30-2011, 03:30 AM   #1
wringer
LQ Newbie
 
Registered: Jul 2009
Posts: 7

Rep: Reputation: 0
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!
 
Old 06-30-2011, 05:06 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,987
Blog Entries: 54

Rep: Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742Reputation: 2742
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).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Directory Traverse & Rename Script fsckin Programming 3 10-05-2008 01:43 AM
Bash script to traverse directory tree and rename files intramaweb Programming 3 10-08-2006 12:51 PM
Trying to traverse a directory to change file permissions bskrakes Linux - Newbie 4 09-14-2006 04:38 PM
Script tar+gzip traverse a directory gn00kie Programming 7 06-16-2006 01:52 AM
is there a way to traverse a directory structure & execute a command hemlock Linux - Newbie 1 09-07-2002 12:22 AM


All times are GMT -5. The time now is 04:53 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration