Help with using find for other permission


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Help with using find for other permission
# 1  
Old 02-25-2016
Help with using find for other permission

Hi,

I am using the following find command to search for file permissions that I have to correct

Code:
 
 find . -perm 777 -type f -print
find . -perm 777 -type d -print

I then do a chmod o-w,o-r,o-x to make them not not 777.

I am also needing to search for where the others has been granted READ ONLY, WRITE ONLY or EXECUTE only and get rid of these permissions. I am assuming that will be using -perm 700, -perm 070 and -perm 007, is that correct?

At the moment, the find is showing results for where user and group is 777 as well.

Is there anyway to tell find to search for the others permission only, that is, exclude the user and group permission from the find?

Please advise. Thanks.
# 2  
Old 02-25-2016
The following should work:
Code:
find sub \( -perm -01 -o -perm -02 -o -perm -04 \) -exec chmod o= {} +

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find list of files missing read & execute permission

Hi, I'm writing a post-upgrade script and I want to find which files don't have read and execute to everyone. I can run a find . ! -perm, but then I have to use a list of the possible permissions (777,775, 755 etc). Is there a more elegant solution? Thanks (2 Replies)
Discussion started by: Catullus
2 Replies

2. UNIX for Dummies Questions & Answers

How to find out who changed the file permission in unix

Can any one tell me is there any command to find out who changed the permission of a file Or is there any log file so that i can find out who has changed the permission of a file? Thanks in Advance:) (7 Replies)
Discussion started by: Uttamnsd
7 Replies

3. UNIX for Dummies Questions & Answers

Find - prints Permission denied

Hi, I'm trying to search for files with a particular pattern using the below command. find . -name file_1.txt -print It gives Permission denied error on several files, using standard error, how do we ignore this error and print only the valid matches. find:... (1 Reply)
Discussion started by: Dev_Dev
1 Replies

4. Shell Programming and Scripting

Find without the "Permission non granted" list ...

Hi, When I use the Find command under the root directory ("/") of my Ubuntu, I get the good answers mixed inside a long list of "Permission non granted" (in fact and with my French version, I get "Permission non accordée" !). After several unsuccessful tries with -perm or -executable options... (4 Replies)
Discussion started by: Micla
4 Replies

5. Fedora

Find Files in Directory by Permission?

Hello. I need to write a script that lets the user pick a directory. Then, all files are looped through, and the ones with read-write (for current user I think) are listed. Ending with a count of those files, but that parts easy. What I'm confused about is the middle. So far I have ... (15 Replies)
Discussion started by: Feuyaer
15 Replies

6. Ubuntu

Permission (I Think)

Pictures by worthamtx - Photobucket The URL is graphic view my present concern. Old partition working great sdb1 both appear on nautilus, both deliver icons to desk top. Based on the label handling of gparted results I tried following with success sudo mkdir /media/disk/data sudo chown... (1 Reply)
Discussion started by: 77yrold
1 Replies

7. Shell Programming and Scripting

Find File with permission below 664

Hi Using find i want to find files with permission below 664. (6 Replies)
Discussion started by: aliahsan81
6 Replies

8. Shell Programming and Scripting

Find all files with group read OR group write OR user write permission

I need to find all the files that have group Read or Write permission or files that have user write permission. This is what I have so far: find . -exec ls -l {} \; | awk '/-...rw..w./ {print $1 " " $3 " " $4 " " $9}' It shows me all files where group read = true, group write = true... (5 Replies)
Discussion started by: shunter63
5 Replies

9. UNIX for Dummies Questions & Answers

Find who has permission to delete

All, I am running a script , which has permision as below -r-xr-x--- 1 pmgr ffw 11660 Sep 3 2003 ccln and tring to delete the file in the directory inter (sys212:pct:/>) ll | grep ^d dr-xr-xr-x 32 bin bin 8192 Dec 24 03:24 etc drwxr-xr-x 32... (2 Replies)
Discussion started by: arunkumar_mca
2 Replies

10. UNIX for Dummies Questions & Answers

Permission?

What does the following permission indicate? -rwSr----- 1 oracle dba 1536 Nov 7 17:05 orapwRTMDB Thanks, Rahul. (1 Reply)
Discussion started by: rahulrathod
1 Replies
Login or Register to Ask a Question